加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Capistrano RVM和Ubuntu RVM不是一个功能,用’

发布时间:2020-12-17 02:34:07 所属栏目:百科 来源:网络整理
导读:我正在尝试在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
我正在尝试在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'

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读