2012-04-22 71 views
1

当我运行耙分贝:迁移在我的控制台:的Rails 3耙错误您已经激活了耙0.9.2.2,但你的Gemfile需要耙0.9.2

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) 
+1

你有没有尝试'捆绑exec耙db:migrate'? – 2012-04-22 20:51:32

+0

是的,它的工作原理,但它不是一个方便的解决方案... – 2012-04-22 20:52:35

+1

好吧,所以你的问题真的是“我怎样才能避免捆绑执行”。 – 2012-04-22 20:53:17

回答

7

这可能是因为你有一个新在您的系统上使用Rake版本。你可以这样做:bundle exec rake db:migrate它在你的应用上下文(rake 0.9.2)中运行rake,或者只是删除你的Gemfile.lock并重新绑定。

0

同样的事情发生在我身上,bundle exec当然在终端工作,但RubyMine不会听。事实证明,global gemset使用了比我的'本地'宝石集更新的rake -version,我最终从global gemset卸载rake,以使RubyMine再次开心(在重新启动之后)。