Reputation: 161
My environment is ruby 1.9.3p327
and rails 3.2.8
on a mac.
I add the gem nokogiri
to my Gemfile
. Run bundle install
command. The command show me Using nokogiri (1.5.5)
and the gem list
command return nokogiri (1.5.5)
.
In the rails console require 'nokogiri'
return false
but in irb
it return true
.
How is this possible?
Upvotes: 14
Views: 5423
Reputation: 5398
According to the first two lines of the API documentation, require
will:
true
if load successfulfalse
if already loadedLoadError
if file cannot be foundSince Rails console loads your gems, Nokogiri was probably required earlier. Irb doesn't do that.
Upvotes: 38