Rails 3 rake error你已经激活了rake 0.9.2.2,但你的Gemfile需要rake 0.9.2

时间:2012-04-22 20:28:12

标签: ruby-on-rails ruby-on-rails-3

当我在我的控制台中运行rake db:migrate时:

rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. C
onsider using bundle exec.

(See full trace by running task with --trace)

C:\Rails\myapp>bundle install
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.4)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.30)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using addressable (2.2.6)
Using bundler (1.0.18)
Using multipart-post (1.1.4)
Using faraday (0.7.6)
Using friendly_id (4.0.0)
Using hashie (1.2.0)
Using json (1.6.1)
Using multi_json (1.0.4)
Using mysql (2.8.1)
Using oauth2 (0.5.2)
Using omniauth (1.0.2)
Using omniauth-oauth2 (1.0.0)
Using omniauth-facebook (1.2.0)
Using rdoc (3.10)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using rest-client (1.6.7)
Using sequel (3.20.0)
Using simple_form (1.5.2)
Using sinatra (1.0)
Using sqlite3 (1.3.4)
Using sqlite3-ruby (1.3.3)
Using taps (0.3.23)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.

rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. C
onsider using bundle exec.

(See full trace by running task with --trace)

2 个答案:

答案 0 :(得分:7)

这可能是因为您的系统上有一个较新的Rake版本。您可以执行错误说明:bundle exec rake db:migrate在您的应用程序上下文中运行rake(rake 0.9.2),或者只是删除您的Gemfile.lock并再次捆绑。

答案 1 :(得分:0)

同样的事情发生在我身上,bundle exec当然在终端工作,但RubyMine不会听。事实证明,global gemset使用的是较新的rake - 版本而不是我的'本地'gem集,我最终从rake gemset卸载global以生成RubyMine再次开心(重启后)。