本文介绍了bundle update rake 没有修复我的“你已经激活了 rake ...."错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Ubuntu 终端中运行 rake db:migrate 时,我不断收到错误:

When I run rake db:migrate in Ubuntu Terminal I keep getting the error:

rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.

我在stackoverflow上看到一种解决这个问题的方法是运行:

I saw on stackoverflow a way to solve this problem is to run:

bundle update rake

所以我这样做,我得到:

So I do this and I get:

Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.6)
Using SystemTimer (1.2.3)
etc...
etc...

    Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

这不是应该将 rake 更新到 10.0.4 吗?因为当我运行 rake db:migrate 时,我仍然收到错误:

Isn't this supposed to update rake to 10.0.4? Because when I run rake db:migrate I still get the error:

rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.

有什么想法可以解决这个问题吗?当我运行 gem env 我得到:

Any ideas how I can solve this problem? When I run gem env I get:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.15
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  - INSTALLATION DIRECTORY: /var/lib/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/1.8
     - /home/mycompaq/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

会不会和 GEM PATHS 有冲突?感谢您的帮助.

Could there be some conflict with the GEM PATHS? Thanks for any help.

推荐答案

我总是建议在任何此类命令之前使用bundle exec"

I always recommend to use "bundle exec" before any such commands

bundle exec rake db:migrate

这篇关于bundle update rake 没有修复我的“你已经激活了 rake ...."错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 04:51