Reputation: 6044
I just installed a ruby gem
gem install anemone
But I cannot hit off to use it directly in my rails application, this is the first time I'm using an external ruby library so it will be very helpful if you can give me an insight into it rather than just a solution
Cheers
Upvotes: 1
Views: 1501
Reputation: 103859
In your Gemfile
add:
gem 'anemone'
This way Rails will load the library when it starts, and you can then use it. You don't even have to use the require
keyword.
Upvotes: 4
Reputation: 37366
You also need to use 'require' and the name of the library on top of the file where you want to use the library. For example if you are using nokogiri you would need to add the line require 'nokogiri'
Upvotes: 0
Reputation: 20591
You must put used libraries into Gemfile. Everything about gemfiles is available on Bundler page.
Upvotes: 2