TIL: OpenURI

Today in DUMB MISTAKES …

Lord have mercy. This morning I was messing around on a Ruby project and was having all sorts of issues with bundle install. I was getting error messages saying that Bundler coudn’t find any of my gems, even though I clearly included them in the GemFile. The errors looked something like this:

Could not find gem 'open-uri (>= 0) ruby' in the gems available on this machine
Could not find gem 'pry (>= 0) ruby' in the gems available on this machine

I tried all sorts of things, including the old delete and reinstall trick, poking around in GemSpec, and lots and lots of Googling. Ultimately, the issue turned out to be the module OpenURI. OpenURI is built into the standard Ruby library. To use it, you just need to “require ‘open-uri’”. There is no need to include Open-uri in your GemFile. In fact, if you do, Bundler will be very unhappy. :p

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll To Top