当我rake db:migrate
在 Ubuntu 终端中运行时,我不断收到错误消息:
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上看到解决这个问题的一种方法是运行:
bundle update rake
所以我这样做,我得到:
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
我仍然得到错误:
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
我得到:
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 有冲突?谢谢你的帮助。