Search code examples
ruby-on-railsrubybundlerrbenv

Cannot find openuri


I'm trying to run bundle install on my rails project (I've just added Nokogiri) but I ran into a permission error. I installed rbenv (which seems like the right way to go) to get around that problem but now I'm getting

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

I know that open-uri is part of ruby though so why am I getting this error?


Solution

  • OpenURI is part of the Ruby Standard library, it is not a gem. You therefor do not need to include it in your Gemfile, just require it in your code.

    require 'open-uri'
    
    open('http://stackoverflow.com/')