0

在我的 rails 项目中运行 bundle install 时出现错误。

sahil@debian:~/workspace/blog$ bundle install
/usr/bin/env: ruby: No such file or directory

红宝石

sahil@debian:~/workspace/blog$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86__64-linux]

sahil@debian:~/workspace/blog$ which ruby
/home/sahil/.rvm/bin/ruby

通过 rvm 安装 ruby​​ 时收到以下错误。

Error running 'env GEM_PATH=/home/sahil/.rvm/gems/ruby-2.0.0-p0:/home/sahil/.rvm/gems/ruby-2.0.0-p0@global:/home/sahil/.rvm/gems/ruby-2.0.0-p0:/home/sahil/.rvm/gems/ruby-2.0.0-p0@global GEM_HOME=/home/sahil/.rvm/gems/ruby-2.0.0-p0 /home/sahil/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /home/sahil/.rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /home/sahil/.rvm/log/ruby-2.0.0-p0/rubygems.install.log

rvm 环境

sahil@debian:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/sahil/.rvm/gems/ruby-2.0.0-p0
- RUBY EXECUTABLE: /home/sahil/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/sahil/.rvm/gems/ruby-2.0.0-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
 - /home/sahil/.rvm/gems/ruby-2.0.0-p0
 - /home/sahil/.rvm/gems/ruby-2.0.0-p0@global
- GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => t

rvm env 看起来不错。不知道我错过了什么。

4

1 回答 1

0

请遵循使用 RVM 的基本步骤(从https://stackoverflow.com/a/15570121/497756复制):

rvm install 2.0.0
rvm use 2.0.0 --default # The default arg is needed only first time
gem install bundler
bundle install

还有另一个显示更多细节的答案:https ://stackoverflow.com/a/10591301/497756

于 2013-03-29T10:22:41.297 回答