我正在尝试在 Ubuntu 上安装一个使用 ruby 的应用程序。我安装了RVM和Ruby 2.0并运行rake install
,但Rake尝试使用旧系统版本的Ruby。所以我卸载了系统版本并再次尝试运行 Rake。这次它说"没有这样的文件"。如何让耙子使用 RVM 的红宝石?下面是不同命令的输出。
$ rake install
sudo bundle --without production staging test levelbuilder --quiet
sudo: unable to execute /usr/local/bin/bundle: No such file or directory
rake aborted!
...
/home/ubuntu/../rake_utils.rb:33:in `system'
..
/home/ubuntu/../rake_utils.rb:43:in `bundle_install'
/home/ubuntu/../Rakefile:198:in `block (3 levels) in <top (required)>'
..
/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `eval'
...
路径和版本看起来正确:
$ echo $PATH
/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/bin:/home/ubuntu/.rvm/gems/ruby-2.0.0-p643@global/bin:/home/ubuntu/.rvm/rubies/ruby-2.0.0-p643/bin:/home/ubuntu/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
$ ruby -v
ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-linux]
$ which ruby
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p643/bin/ruby
这是我的.bash_profile:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
这是 .bashrc 的底部:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting.
执行source ~/.bash_profile