2

How to use an external library in Ruby?

I just installed Addressable library as stated in the documentation and write the following code:

require 'addressable/uri'

and it still says:

E:/software/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- addressable/uri (LoadError)

What am I doing wrong? How can I fix it?

FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
  • 3
    It seems to not find your installed gem. Did you install it under the same ruby version? Is addressable listed in the output of command 'gem list' ? – Sam Jun 02 '16 at 20:27
  • Is it a Rails app? Or really what I'm asking is, does your app use bundler? All Rails apps do. Other apps can. Do you have a `Gemfile`? – jrochkind Jun 03 '16 at 01:06

2 Answers2

0

You need install addressable. Run the following in your command line:

$ gem install addressable
tinyoverflow
  • 1,933
  • 3
  • 13
  • 29
0

Maybe you can try uninstall all versions of addressable, and then reinstall it.

Sherllo
  • 166
  • 1
  • 10