我第一次尝试在 ubuntu 服务器上部署我的应用程序。
我一直遇到这个错误:
2013-03-24 15:13:36 executing `deploy:run_migrations'
* executing "rvm gemset use vapin"
servers: ["111.111.111.11"]
[111.111.111.11] executing command
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] RVM is not a function, selecting rubies with 'rvm use ...' will not work.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] You need to change your terminal emulator preferences to allow login shell.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] Sometimes it is required to use `/bin/bash --login` as the command.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] Please visit https://rvm.io/integration/gnome-terminal/ for a example.
这是我的一些 deploy.rb 文件:
require 'bundler/capistrano'
require 'rvm/capistrano'
# set the ruby version
#set :rvm_ruby_string, 'ruby-1.9.3-p392'
#set :rvm_type, :system
# set the rvm gemset to use
set :rvm_gemset, 'vapin'
...
task :install do
run "rvm gemset use #{rvm_gemset}"
run "cd #{current_path} && bundle install --without=test"
end
RVM 安装在我的服务器上。
$ which rvm
/usr/local/rvm/bin/rvm
$ which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
任何帮助表示赞赏。这几天我一直在谷歌上搜索。
编辑
我已经卸载了 RVM 的多用户安装并重新安装了单用户版本。
我在 deploy.rb 脚本中添加了这一行: set :default_shell, "/bin/bash --login" # required for rvm scripts to work proper
现在我没有收到“RVM 不是函数......”错误。
问题是当 bundle install 运行时,gem 没有安装在我的 rvm gemset 中。