Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 使用Capistrano部署RVM时sudo出现问题_Ruby On Rails_Ruby_Rvm_Capistrano - Fatal编程技术网

Ruby on rails 使用Capistrano部署RVM时sudo出现问题

Ruby on rails 使用Capistrano部署RVM时sudo出现问题,ruby-on-rails,ruby,rvm,capistrano,Ruby On Rails,Ruby,Rvm,Capistrano,我想使用Capistrano在我的服务器上部署我的应用程序 我有包含以下内容的deploy.rb文件: set :user, "deploy" set :use_sudo, true set :deploy_to, "/webapps/#{application}" #set :deploy_via, :remote_cache #Using this option avoids to do a full repository clone #RVM set :rvm_type, :syste

我想使用Capistrano在我的服务器上部署我的应用程序 我有包含以下内容的deploy.rb文件:

set :user, "deploy"
set :use_sudo, true
set :deploy_to, "/webapps/#{application}"
#set :deploy_via, :remote_cache #Using this option avoids to do a full repository clone


#RVM
set :rvm_type, :system  #System Wide installation
set :rvm_ruby_string, 'ree@K2'
set :rvm_install_shell, :bash

before 'deploy:setup','rvm:install_rvm'
before 'deploy:setup', 'rvm:install_ruby'

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
   task :start do ; end
   task :stop do ; end
   task :restart, :roles => :app, :except => { :no_release => true } do
     run "touch #{File.join(current_path,'tmp','restart.txt')}"
   end
 end
当我设置根用户、安装RVM(系统范围安装)甚至Ruby Enterprise时,一切都正常,但当我运行'cap deploy:setup'设置use_sudo选项和deploy user时,得到以下信息:

$ cap deploy:setup
  * executing `deploy:setup'
    triggering before callbacks for `deploy:setup'
  * executing `rvm:install_rvm'
  * executing "bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)"
    servers: ["myserver.com"]
Password: 
    [myserver.com] executing command
    [myserver.com] bash -c 'bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)'
*** [err :: myserver.com] bash: line 304: /usr/local/rvm/RELEASE: Permission denied
    command finished in 564ms
failed: "bash -c 'bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)'" on myserver.com
$cap部署:安装程序
*正在执行“部署:安装”
在回调“部署:安装程序”之前触发
*正在执行'rvm:install_rvm'

*执行“bash-s stable<请使用
1.1.0
进行测试:

gem install rvm-capistrano

您的部署用户是sudoer吗?是的,我认为它包含在sudoer文件中。谢谢,我已经将该问题链接到了这个问题上。我希望他们能够解决这个问题。谢谢,我直到今天才有时间测试它。它似乎可以工作。但是,现在ruby enterprise没有安装:
警告:**[err::myserver.com]未能创建文件ruby-enterprise-1.8.7-2012.02.tar.gz
@ianenri打开一个包含更多详细信息的新问题。