有了chruby,为什么ruby-2.2.0
中.ruby-version
不会工作,而chruby ruby-2.2.0
会不会这样做?
% whoami
mark
% sudo su myapp
% cd /home/www/myapp/
% whoami
chruby: unknown Ruby: ruby-2.2.0
myapp
% cat .ruby-version
ruby-2.2.0
% which ruby
/usr/local/bin/ruby
% chruby ruby-2.2.0
% which ruby
/home/www/myapp/.rubies/ruby-2.2.0/bin/ruby
Ruby on Rails部署的完整记录:
答案 0 :(得分:2)
在.ruby-version
中只放2.2.0
,即
echo 2.2.0 > .ruby-version