供应商/捆绑包和 ruby​​ 版本 [英] vendor/bundle and ruby version

查看:43
本文介绍了供应商/捆绑包和 ruby​​ 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我是否在使用 rbenv 和 bundler 时做错了.

I want to know if I'm doing incorrectly with rbenv and bundler.

我正在使用 rbenv 和 ruby​​ 2.1.2,就像这样

I'm using rbenv and ruby 2.1.2, like so

rbenv versions
  system
* 2.1.2 (set by /home/deploy/cp/repo/.ruby-version)

我跑

bundle install --deployment --without=development,test --path=vendor/bundle

来自 /home/deploy/cp

但是得到

vendor/bundle/ruby/2.1.0

用我所有的宝石创造的.是否有我不知道的 bundler 版本控制方案,或者我应该看到一个

created with all my gems. Is there a versioning scheme I'm unaware of for bundler, or should I see a

/home/deploy/cp/repo/vendor/bundle/ruby/2.1.2

目录?

推荐答案

我也注意到了这一点,我只是假设它一定只是 Bundler 正在使用的约定.我有已从 1.9.3 升级到 2.1.2 的应用,并且:

I've noticed this too, I just assumed it must just be a convention Bundler is using. I have apps that have been upgraded from 1.9.3 to 2.1.2, and I have:

/path/to/shared/bundle
  /ruby
    /1.9.1
    /2.1.0

这些机器从未安装过 1.9.1 或 2.1.0,只有 1.9.3 和 2.1.2.

These machines have never had 1.9.1 or 2.1.0 installed, only 1.9.3 and 2.1.2.

好的,所以我是为了好玩而挖的......它来自 Bundler::Installer#generate_standalone:

edit: Ok so I dug for fun... It comes from RbConfig in Bundler::Installer#generate_standalone:

(nick@thin)-(~)
(505)⚡️ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

(nick@thin)-(~)
(506)⚡️ pry
[1] pry(main)> RbConfig::CONFIG['ruby_version']
=> "2.1.0"

这篇关于供应商/捆绑包和 ruby​​ 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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