Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.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在尝试部署时抱怨_Ruby On Rails_Capistrano_Rvm Capistrano - Fatal编程技术网

Ruby on rails Capistrano在尝试部署时抱怨

Ruby on rails Capistrano在尝试部署时抱怨,ruby-on-rails,capistrano,rvm-capistrano,Ruby On Rails,Capistrano,Rvm Capistrano,这就是我得到的。不知道发生了什么事。想法 编辑mydeploy.rb $ bundle exec cap -S branch=master production deploy --dry-run /Users/myname/.rvm/lib/rvm/capistrano.rb:5: RVM - Capistrano integration was extracted to a separate gem, install: `gem install rvm-capistrano` and remo

这就是我得到的。不知道发生了什么事。想法

编辑my
deploy.rb

$ bundle exec cap -S branch=master production deploy --dry-run
/Users/myname/.rvm/lib/rvm/capistrano.rb:5: RVM - Capistrano integration was extracted to a separate gem, install: `gem install rvm-capistrano` and remove the `$LOAD_PATH.unshift` line, note also the 'set :rvm_type, :user' is now the default (instead of :system). (RuntimeError)

您可以发布新的deploy.rb文件吗?此外,确认rvm capistrano gem是否已安装


另外,如果尚未将
添加到deploy.rb文件的顶部,则需要“rvm/capistrano”
。这就是我的工作。

这是我的工作。这些是我必须使用rvm capistrano gem的唯一线路。如果有帮助的话,我也会以非sudo用户的身份进行部署

# RVM is used for ruby 1.9.2 - this is so cap can see the rvm gemset.
$LOAD_PATH.unshift "lib", File.expand_path('./lib', ENV['rvm_path'])

set :stages, %w(sandbox qa production)
require 'capistrano/ext/multistage'
require 'bundler/capistrano'
require 'airbrake/capistrano'
require 'chef/capistrano'
require 'secure_files/capistrano'
require "rvm/capistrano"

set :rvm_ruby_string, '1.9.2'
set :rvm_bin_path, '/usr/local/rvm/bin'
set :user, "root"
set :scm, :git
set :repository,  "git@github.com:Myact/fbadapter.git"
set :deploy_to, '/var/www/fbadapter'
set :deploy_via, :remote_cache
set :rails_env, Proc.new {stage}
set :application, 'fbadapter'
set :default_environment, Proc.new { { 'RAILS_ENV' => stage } }
set :rake, "bundle exec rake --trace"
set :foreman_bin, 'bundle exec foreman'
set :rake, "#{foreman_bin} run rake"  
set :rails, "#{foreman_bin} run rails"
set :app_user, 'www-data'

set :bundle_without,  [:development, :test, :ops, :darwin]

# this must be set before foreman/capistrano is read
set :foreman_roles, [:app]
require "foreman/capistrano"

after 'multistage:ensure' do
 role_from_chef :db, 'app', :limit => 1, :primary => true # perform db operations on one of the app servers
 role_from_chef :web, 'app'
 role_from_chef :app
 role_from_chef :queue
 role_from_chef :cron
end


before 'deploy:symlink', 'deploy:assets:precompile', 'deploy:migrate'
after 'deploy:symlink', :set_application_permissions

after 'deploy', 'deploy:cleanup', 'campfire:deploy_stop'
after 'rollback', 'campfire:deploy_rollback'

desc 'Changes the permissions for the release path to be used with www-data'
task :set_application_permissions do
  run "chown -R #{app_user}:#{app_user} #{release_path}/*"
end

# These services are monitored by monit, but interacting with them that way
# is hugging-every-cat crazy. This means we're assuming two thin procs per
# app server; if that changes then remember to change this too.

namespace :deploy do
  task :stdout_logger do 
    run "cd #{release_path} && #{rails} plugin install https://github.com/ddollar/rails_log_stdout.git"
  end

  before 'deploy:symlink', 'deploy:stdout_logger'
end
我还注意到您正在使用“root”用户进行部署。相当肯定的是,除非为root用户安装了rvm,否则这不会起作用。如果您必须使用root用户,我会尽可能使用rvm包装器


祝你好运

你能分享你的deploy.rb吗?你做了错误消息中说的吗?我做了,但是得到:
$bundle exec cap-S branch=master production deploy--dry run/Users/shamoon/.rvm/gems/ruby-1.9.2-p320@fbadapter/gems/capistrano-2.8.0/lib/capistrano/configuration/loading.rb:152:in
require':没有要加载的文件--rvm/capistrano(LoadError)`哪套capistrano配方是您当前设置的基础?它以前是否工作过?相关:我已经有
要求“rvm/capistrano”
。帖子中有我最新的
deploy.rb
。我如何确认
rvm capistrano
确实安装了?“gem列表| grep rvm capistrano”如果您发布了最新的deploy.rb,那么您没有删除它说您需要删除的加载路径行,也没有添加您需要添加的“require”rvm/capistrano”行……没有使用
root
,只是在帖子中省略了我的用户名使用root我指的是这一行“set:user”,root
set :rvm_ruby_string, '<interpreter>@<gemset>'

# Load RVM's capistrano plugin.
require "rvm/capistrano"
set :rvm_path, "$HOME/.rvm"
LOAD_PATH.unshift "lib", File.expand_path('./lib', ENV['rvm_path'])