我正在使用 rbenv 来管理我的红宝石。 Heroku似乎根据他们的Ruby Support docs仅(或至少更喜欢)Bundler v1.15.2
。
所以我:
$ bundle exec gem install bundler -v 1.15.2
这是Ruby 2.4.4的gem目录中唯一的Bundler版本。
但是当我bundle install
或bundle update
时,Gemfile.lock
说:
BUNDLED WITH
1.16.2
这会在部署{Heroku}甚至每次bundle update <some_gem>
时在本地给我警告。
我最近确实更新了 rubygems :
$ gem -v
2.6.14.1
$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.7.7.gem (100%)
Successfully installed rubygems-update-2.7.7
Installing RubyGems 2.7.7
Bundler 1.16.2 installed
RubyGems 2.7.7 installed
Regenerating binstubs
其中解释了为什么bundler 1.16.2
在我的系统上,但如何强制它在Ruby的目录中提供版本并终止所有这些警告:
警告:Bundler(1.15.2)的运行版本早于 创建锁定文件的版本(1.16.2)。我们建议您升级到 通过运行
gem install bundler
获得Bundler的最新版本。
编辑: gem env
根据请求
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.7
- RUBY VERSION: 2.4.4 (2018-03-28 patchlevel 296) [x86_64-darwin18]
- INSTALLATION DIRECTORY: /Users/meltemi/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
- USER INSTALLATION DIRECTORY: /Users/meltemi/.gem/ruby/2.4.0
- RUBY EXECUTABLE: /Users/meltemi/.rbenv/versions/2.4.4/bin/ruby
- EXECUTABLE DIRECTORY: /Users/meltemi/.rbenv/versions/2.4.4/bin
- SPEC CACHE DIRECTORY: /Users/meltemi/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/meltemi/.rbenv/versions/2.4.4/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-18
- GEM PATHS:
- /Users/meltemi/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
- /Users/meltemi/.gem/ruby/2.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/meltemi/.rbenv/versions/2.4.4/bin
- /usr/local/Cellar/rbenv/1.1.1/libexec
- /Users/meltemi/.rbenv/shims
- /usr/local/heroku/bin
- .git/safe/../../bin
- /Users/meltemi/.bin
- /usr/local/sbin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/X11/bin