Closed wlipa closed 3 years ago
In the 2.6 snap, there's a 1.17.2 bundler at 2.6.0/bundler and a 2.0.1 bundler at gems/2.6.0/gems/bundler-2.0.1.
$ grep -m1 VERSION /snap/ruby/132/lib/ruby/2.6.0/bundler/version.rb
VERSION = "1.17.2" unless defined?(::Bundler::VERSION)
$ grep -m1 VERSION /snap/ruby/132/lib/ruby/gems/2.6.0/gems/bundler-2.0.1/lib/bundler/version.rb
VERSION = "2.0.1" unless defined?(::Bundler::VERSION)
Installing bundler 2.0.1 as a user does not seem to work. Is there a way to get bundler 2.0.1 working with the 2.6 snap? (This is with the default gem env.)
$ gem install bundler
Fetching bundler-2.0.1.gem
Successfully installed bundler-2.0.1
$ ~/.gem/bin/bundle --version
Bundler version 1.17.2
It looks like the ruby snap works by setting the RUBYLIB
environment variable in order to ensure that /snap/ruby/132/lib/ruby/2.6.0
is included in the ruby load path:
RUBYLIB
always comes first in the load path, before any gems. That means that the version of bundler that comes with Ruby 2.6 (i.e. /snap/ruby/132/lib/ruby/2.6.0/bundler.rb
) will always take precedence over any version that is installed via rubygems.
I don't see a way to solve this unless the snap can somehow be packaged without relying on RUBYLIB
, or unless bundler is removed from ruby's standard library.
I wouldn't necessarily mind using ruby's included bundler / rubygems if they were kept up to date. To be honest, I find the current relationship between ruby, rubygems, and bundler to be rather baffling.
After Ruby 2.6, Ruby bandled bundler as stdlib. I relied on its default version.
The version of bundler in the 2.6 channel is 1.x, but the version of bundler in the 2.5 channel is 2.x. It's surprising that upgrading a major version of ruby would downgrade a major version of bundler.
(I'm not sure if this is due to the snap packaging or not, though.)