I am attempting to get a gem I installed working in a Rails application. I can require the gem just fine in a Ruby program that I run from the command line using:
require 'nokogiri'
But when I attempt to do the same in one of my Rails controllers it errors saying ‘no such file to load — nokogiri’.
I tried using the full path to the lib/nokogiri.rb file, but that fails because it cannot find ‘nokogiri/native’.
Better, place the following in your environment.rb file:
This will tell Rails that you depend on that particular gem. It also allows you to specify particular versions, and it will automatically keep all your gems synched, or unpack them into vendor/gems if you so wish.