1

当我在控制台中运行 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)
4

2 回答 2

7

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

于 2012-04-22T20:52:21.133 回答
0

我也遇到了同样的情况,bundle exec当然在终端中工作,但 RubyMine 不听。事实证明,globalgemset 使用了rake比我的“本地”gem set 更新的版本,我最终rakeglobalgemset 中卸载以使 RubyMine 再次高兴(在重新启动之后)。

于 2012-11-20T16:24:21.153 回答