2012-04-09 3 views
1

私は、レール2.xアプリをレール3.0.12にアップデートしています。rails 3.0.12 update - この宝石のレーキタスクがロードされないのはなぜですか?

このアプリケーションは、データベースを「シード」するためにブートストラップの宝石を使用しました。宝石のoriginal forkは、レール2.xブランチで停止しているようですが、(理論上)レール3.2と互換性のあるこの他のフォークが見つかりました(3.2.1ではなく、3.0.12にアップデートしています)。

は、これが私のGemfileが今持っているものです。

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

バンドルのアップデートを実行した後、これは宝石がrake db:bootstrapと呼ばれる新しいrakeタスクを追加することになっていることを除いて...動作しているようですが、それはdoesnの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 

私はレポをチェックしました、そしてthis postによると、宝石が正しいことをやっているようだ: - それはrake file をロードrailtie.rbファイルを持っている - railtie.rbファイルはに含まれていますthe lib/bootstraper.rb file

まだ、レーキタスクは表示されません。

rake 3.0.xから3.2.xに大幅に変更されたgemにrakeタスクを追加するプロセスはありますか?

私はRuby 1.9.3を実行しています。

ありがとうございました。

EDIT:

私はレール3.0.12での新しい空のレールのプロジェクトを作成したが、Gemfileに線を追加し、バンドルした後、rakeタスクが表示されます。これは、新しいレール3.0.12の新しいプロジェクトを作成する代わりに、レール2.xから更新するという事実に関連している可能性があります。

答えて

0

いいえ、問題が見つかりました。

古い(レール2.x)ブートストラップの宝石には、lib/tasks/bootstrapper.rakeというファイルが必要でした。私は自分のレールプロジェクトでこのファイルを持っていましたが、それはレーキの仕事を混乱させていました。ファイルを削除すると問題が解決しました。