ruby-on-rails-3 – RVM,Capistrano和bundler路径问题

前端之家收集整理的这篇文章主要介绍了ruby-on-rails-3 – RVM,Capistrano和bundler路径问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我手动安装时与生产商的宝石路径之间的差异似乎与捆绑卡尼斯特拉诺之间存在差异.

在rvm安装ruby 1.9.2并创建gemset“myapp”之后,我确实通过gem install bundler安装了bundler.

它安装在路径中:

/usr/local/rvm/gems/ruby-1.9.2-p290@myapp/gems

通过Capistrano的Bundler将剩余的宝石安装到:

/usr/local/rvm/gems/ruby-1.9.2-p290@myapp/ruby/1.9.1/gems

我的deploy.rb文件的开头是:

$:.unshift(File.expand_path('./lib',ENV['rvm_path']))
require 'rvm/capistrano'
require 'bundler/capistrano'

set :rails_env,'production'
set :rvm_type,:system
set :rvm_ruby_string,"ruby-1.9.2-p290@myapp"
set :rvm_path,"/usr/local/rvm"
set :rvm_bin_path,"#{rvm_path}/bin"
set :rvm_lib_path,"#{rvm_path}/lib"

set :default_environment,{
  'PATH'                    => "#{rvm_path}/gems/ruby/1.9.1/bin:#{rvm_bin_path}/bin:$PATH",'RUBY_VERSION'    => '1.9.2','GEM_HOME'        => "#{rvm_path}/gems/#{rvm_ruby_string}",'GEM_PATH'        => "#{rvm_path}/gems/#{rvm_ruby_string}",'BUNDLE_PATH'     => "#{rvm_path}/gems/#{rvm_ruby_string}"
}

set :bundle_dir,"#{rvm_path}/gems/#{rvm_ruby_string}"
set :bundle_flags,"--deployment --verbose"

解决方法

令人讨厌的是,捆绑人员无意与RVM合作并希望捆绑器管理ruby版本,因此到目前为止我的解决方法是简单地用符号链接ruby和我的GEM_PATH目录中指向“.”的1.9.1.
原文链接:https://www.f2er.com/ruby/269650.html

猜你在找的Ruby相关文章