vendor/bundle and ruby version

我与影子孤独终老i 提交于 2019-12-13 16:30:49

问题


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

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)

I run

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

from /home/deploy/cp

but get

vendor/bundle/ruby/2.1.0

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

dir?


回答1:


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

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

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"


来源:https://stackoverflow.com/questions/24874556/vendor-bundle-and-ruby-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!