uninitialized constant Rake::DSL エラー

2011年11月28日 Posted by PURGE

C:project>rake db:migrate
(in C:/project)
rake aborted!
uninitialized constant Rake::DSL

どうやらrake のバージョンが良ろしくないらしい。
gem list rake でバージョンを調べる。

C:worksWhoocus_R>gem list rake
*** LOCAL GEMS ***
rake (0.9.2.2, 0.8.7)

で、プロジェクトのGemfile に下記を追記して、bundle install

gem "rake", "0.8.7"
C:project>bundle install
Fetching source index for http://rubygems.org/
You have requested:
  rake = 0.8.7
The bundle currently has rake locked at 0.9.2.2.
Try running `bundle update rake`

また怒られたので、bundle update rake

C:worksWhoocus_R>bundle update rake
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using multi_json (1.0.3)
Using activesupport (3.1.3)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.3)
Using erubis (2.7.0)
Using rack (1.3.5)
Using rack-cache (1.1)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.3)
Using actionpack (3.1.3)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.3)
Using arel (2.2.1)
Using tzinfo (0.3.31)
Using activerecord (3.1.3)
Using activeresource (3.1.3)
Using ansi (1.4.1)
Using bundler (1.0.21)
Using coffee-script-source (1.1.3)
Using execjs (1.2.9)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.6.2)
Using rdoc (3.11)
Using thor (0.14.6)
Using railties (3.1.3)
Using coffee-rails (3.1.1)
Using jquery-rails (1.0.19)
Using mysql2 (0.3.10)
Using rails (3.1.3)
Using sass (3.1.10)
Using sass-rails (3.1.5)
Using turn (0.8.2)
Using uglifier (1.1.0)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
C:project>rake db:migrate
==  CreateMembers: migrating ==================================================
-- create_table(:members)
   -> 0.3906s
==  CreateMembers: migrated (0.3906s) =========================================

うまく行ったようです。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です