Max
Max

Reputation: 11

Issue installing Nokogiri Gem w/ Rails: "Could not find "Nokogiri..."

Nokogiri is in my gem file. Bundle install returns the expected output:

Using nokogiri (1.4.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

When trying to execute db:create:all I get the following error:

rake db:create:all
Could not find nokogiri-1.4.4 in any of the sources

If I test in irb, I also get the expected output.

irb(main):003:0> require "rubygems"
=> true
irb(main):004:0> require "nokogiri"
=> true

I have uninstalled and install nokogiri along with its dependencies multiple times.

I'm using:

Rails 3.0.6 Ruby 1.8.7

Any help would be greatly appreciated.

EDIT: 4/25/11 3:02pm EDT

For comment below: Gemfile line for nokogiri is

gem "nokogiri", '1.4.4', :require => "nokogiri"

Upvotes: 1

Views: 7225

Answers (2)

A Fader Darkly
A Fader Darkly

Reputation: 3636

This may be a long shot but you could try:

bundle install --no-deployment

If you are in deployment mode Rails will look for your gems in the vendor directory, rather then the usual install location. It can cause this kind of error.

Upvotes: 1

Fabiano Soriani
Fabiano Soriani

Reputation: 8572

I made a test with your case in mind.
My Gemfile is like this:

gem "nokogiri", '1.4.4', :require => "nokogiri"

And then rake db:migrate worked just fine

Upvotes: 2

Related Questions