0

rake db:migrateUbuntu ターミナルで実行すると、エラーが発生し続けます。

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

この問題を解決する方法は、次を実行することです。

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.

これはレーキを 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 と競合する可能性はありますか? 助けてくれてありがとう。

4

2 に答える 2

3

そのようなコマンドの前に「bundle exec」を使用することを常にお勧めします

bundle exec rake db:migrate
于 2013-07-30T10:10:29.317 に答える