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和chruby在错误的ruby中寻找bundler_Ruby On Rails_Capistrano_Chruby - Fatal编程技术网

Ruby on rails capistrano和chruby在错误的ruby中寻找bundler

Ruby on rails capistrano和chruby在错误的ruby中寻找bundler,ruby-on-rails,capistrano,chruby,Ruby On Rails,Capistrano,Chruby,我正在尝试在chruby管理的新服务器和ruby版本上部署Capistrano3 工作规范中规定的所有测试均正常 当我尝试进行部署时,它似乎在尝试在系统ruby中查找bundler,而不是在deploy.rb中指定的chruby版本 set :chruby_ruby, 'ruby-2.1.2' 我已经在服务器上安装了ruby 2.1.2和ruby install,如果我以部署用户的身份登录,就会发现使用的是正确的ruby deploy@server:~$ ruby -v ruby 2.1.2p

我正在尝试在chruby管理的新服务器和ruby版本上部署Capistrano3

工作规范中规定的所有测试均正常

当我尝试进行部署时,它似乎在尝试在系统ruby中查找bundler,而不是在deploy.rb中指定的chruby版本

set :chruby_ruby, 'ruby-2.1.2'
我已经在服务器上安装了ruby 2.1.2和ruby install,如果我以部署用户的身份登录,就会发现使用的是正确的ruby

deploy@server:~$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [i686-linux]
部署中的错误是

INFO[8ec8ed42] Running /usr/local/bin/chruby-exec ruby-2.1.2 -- bundle install --binstubs /var/www/oentry/shared/bin --path /var/www/oentry/shared/bundle --without development test --deployment --quiet on 103.6.213.27
DEBUG[8ec8ed42] Command: cd /var/www/oentry/releases/20140810095255 && /usr/local/bin/chruby-exec ruby-2.1.2 -- bundle install --binstubs /var/www/oentry/shared/bin --path /var/www/oentry/shared/bundle --without development test --deployment --quiet
DEBUG[8ec8ed42]     chruby: unknown Ruby: ruby-1.9.3-p392
DEBUG[8ec8ed42]     /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [] (Gem::LoadError
DEBUG[8ec8ed42]     )
DEBUG[8ec8ed42]         from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
DEBUG[8ec8ed42]         from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
DEBUG[8ec8ed42]         from /usr/local/bin/bundle:22:in `<main>'
cap aborted!
production.rb以下所有内容都是默认值

lock '3.2.1'

set :application, 'oentry'
set :repo_url, 'git@1nnn.nnn.nnn.nnn:/opt/git/oentry.git'
set :chruby_ruby, 'ruby-2.1.2'
role :app, %w{deploy@nnn.nn.nnn.nnn}
role :web, %w{deploy@nnn.nn.nnn.nnn}
role :db,  %w{deploy@nnn.nn.nnn.nnn}
卡普里

# Load DSL and Setup Up Stages
require 'capistrano/setup'

# Includes default deployment tasks
require 'capistrano/deploy'

# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
#   https://github.com/capistrano/rvm
#   https://github.com/capistrano/rbenv
#   https://github.com/capistrano/chruby
#   https://github.com/capistrano/bundler
#   https://github.com/capistrano/rails
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
更新

在2.1.2环境中的服务器上执行gem安装捆绑程序似乎可以让它正常工作,但我仍然在输出中收到以下令人不安的消息

DEBUG[1b6631e7]     chruby: unknown Ruby: ruby-1.9.3-p392