微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby-on-rails – Capistrano RVM和Ubuntu RVM不是一个功能,用’rvm use …’选择ruby是行不通的

我正在尝试在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”#rvm脚本正常工作所需的#

现在我没有得到“RVM不是一个函数….”错误.

问题是当捆绑安装运行时,我的rvm gemset中没有安装gem.

解决方法:

在我的deploy.rb文件中,设置此行:

set :bundle_dir, "/usr/local/rvm/gems/ruby-1.9.3-p392"

在此之前:

require 'bundler/capistrano'

似乎帮助捆绑者知道在哪里安装宝石.不知道为什么需要这样做.我以前从未需要它.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐