为什么这个gem的rake任务没有加载?

我正在更新一个rails 2.x应用程序到rails 3.0.12。

这个应用程序使用bootstrapper gem来“种子”数据库。 原来的宝石叉似乎已停止在轨道2.x分支,但我发现(理论上)与轨道3.2(注意,我正在更新到3.0.12,而不是3.2)兼容的其他叉。

所以这就是我的Gemfile现在所具有的:

gem 'bootstrapper', :git => 'git://github.com/vivrass/bootstrapper.git'

运行包更新后,这似乎工作...除了宝石应该添加一个新的名为rake任务rake db:bootstrap ,当我执行它不会出现rake -T db (我曾化名为bundle exec rake -T db通过oh-my-zsh)。

rake db:create                         # Create the database from config/database.yml for the current Rails.env (use db:crea...
rake db:drop                           # Drops the database for the current Rails.env (use db:drop:all to drop all databases)
rake db:fixtures:load                  # Load fixtures into the current environment's database.
rake db:migrate                        # Migrate the database (options: VERSION=x, VERBOSE=false).
rake db:migrate:status                 # Display status of migrations
rake db:rollback                       # Rolls the schema back to the previous version (specify steps w/ STEP=n).
rake db:schema:dump                    # Create a db/schema.rb file that can be portably used against any DB supported by AR
rake db:schema:load                    # Load a schema.rb file into the database
rake db:seed                           # Load the seed data from db/seeds.rb
rake db:setup                          # Create the database, load the schema, and initialize with the seed data (use db:res...
rake db:structure:dump                 # Dump the database structure to an SQL file
rake db:version                        # Retrieves the current schema version number

我已经检查了回购,根据这篇文章,看起来这个宝石正在做正确的事情: - 它有一个加载rake文件的railtie.rb文件 - railtie.rb文件包含在lib / bootstraper中。 rb文件

然而,耙子任务没有出现。

以任何重要的方式将rake任务添加到gem的过程是否已从rails 3.0.x更改为3.2.x?

我正在运行红宝石1.9.3。

谢谢。

编辑:

我在rails 3.0.12中创建了一个新的空栏项目,在Gemfile中添加了这一行,捆绑后,出现了rake任务。 这可能与我从rails 2.x进行更新而不是创建全新rails 3.0.12项目的事实有关。


好的,找到了问题。

旧的(rails 2.x)引导程序gem需要一个名为lib/tasks/bootstrapper.rake的文件。 我在我的导轨项目上有这个文件,并且它正在搞乱耙子任务。 删除文件解决了问题。

链接地址: http://www.djcxy.com/p/81109.html

上一篇: why are the rake tasks of this gem not loaded?

下一篇: Get Gem vendor files in asset pipeline path