RVM,Capistrano和bundler路径问题 [英] RVM, Capistrano and bundler path issues

查看:123
本文介绍了RVM,Capistrano和bundler路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我手工安装vs捆绑器+ capistrano时,似乎在生产的宝石路径上有差异。

在rvm安装ruby 1.9.2并创建gemsetmyapp后,我通过gem install bundler安装了bundler。



它被安装到路径中:


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


Bundler通过Capistrano安装了剩余宝石变成:


/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'
需要'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}
}
$ b $ set:bundle_dir,#{rvm_path} / gems /#{rvm_ruby_string}
set:bundle_flags ,--deployment --verbose


解决方案

捆绑人员无意与RVM协同工作,并希望捆绑软件管理Ruby版本,所以目前为止我的解决方法是简单地符号化地链接ruby,在我的GEM_PATH目录中指向。的1.9.1。


i seem to have a discrepancy between production's gem path when I installed manually versus by bundler+capistrano.

After rvm installing ruby 1.9.2 and creating a gemset "myapp", i did install bundler via gem install bundler.

It was installed into the path:

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

Bundler via Capistrano installed the remaining gems into:

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

Beginning of my deploy.rb file is:

$:.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"

解决方案

Annoyingly, bundler folks have no intention on working well with RVM and want bundler to manage ruby versions so the workaround so far for me is to simply symbollically link for ruby and 1.9.1 in my GEM_PATH directory pointing to "."

这篇关于RVM,Capistrano和bundler路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆