←back to thread

333 points steveklabnik | 1 comments | | HN request time: 0s | source
Show context
msie ◴[] No.45028908[source]
This is cool! A frequent problem I've had with bundler is when the Gemfile lists a newer version of a gem (stringio) but the older version has already been activated. If you can get rid of such errors I would be so happy! Also I've had to frequently update bundler too often when updating a Rails site.
replies(1): >>45034806 #
jacobsenscott ◴[] No.45034806[source]
Just using `bundle exec` should handle that - that's what bundler is for.
replies(1): >>45035215 #
msie ◴[] No.45035215[source]
Yep, didn't work.
replies(1): >>45036234 #
1. byroot ◴[] No.45036234{3}[source]
Yes, this is due to the effort to extract stdlib code into gems https://stdgems.org/

In your case, StringIO use to just be stdlib code so bundler (or rubygems) uses it. Later on it became a gem, so by requiring it before reading the Gemfile, bundler run into this problem of already having loaded the wrong version.

Everytime this happens the bundler team has to modify bundler, and as a user the fix is to upgrade bundler.

You can see they had to vendor a lot of code from default gems to avoid this problem: https://github.com/rubygems/rubygems/tree/c230844f2eab31478f...