我在我的 Gemfile 中以共享路径安装 gems,就像 Capistrano 默认做的那样,当我运行时:
bundle exec rake assets:precompile RAILS_ENV=production
我得到:
You have already activated rake 0.9.2.2, but your Gemfile requires rake 10.0.4. Using bundle exec may solve this.
看到:
cat Gemfile.lock | grep rake
返回:
rake (>= 0.8.7)
rake (10.0.4)
这是我的gem environment
输出:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2013-06-27 patchlevel 448) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/bitnami/my_app/shared/bundle/ruby/1.9.1/
- RUBY EXECUTABLE: /opt/bitnami/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /home/bitnami/my_app/shared/bundle/ruby/1.9.1/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/bitnami/my_app/shared/bundle/ruby/1.9.1/
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gemhome" => "/home/bitnami/my_app/shared/bundle/ruby/1.9.1/"
- "gempath" => ["/home/bitnami/my_app/shared/bundle/ruby/1.9.1/"]
- REMOTE SOURCES:
- http://rubygems.org/
更新
which -a rake
/opt/bitnami/rvm/bin/rake
/opt/bitnami/ruby/bin/rake
更新 2
我尝试提供完整的 rake 路径,但同样的问题
更新 3
重新安装 RVM 后
* WARNING: Found gemhome in /home/bitnami/.gemrc, please remove it, as it will break rubygems in RVM.
* WARNING: Found gempath in /home/bitnami/.gemrc, please remove it, as it will break rubygems in RVM.
If it is intended or a mistake 'export rvm_ignore_gemrc_issues=1' to avoid this warning.
我现在该怎么办?我在那里添加了 gem_home ,因为我希望将我的 gem 安装在我想要的目录中,但不确定这是否是正确的方法。