1

I got a tough problem in ruby and rails.

I have already installed nokogiri-1.6.0, but the rails says that

You have requested:
  nokogiri ~> 1.6.0

The bundle currently has nokogiri locked at 1.5.6.
Try running `bundle update nokogiri`

Then I tried "bundle install", it showed the follow:

Gem files will remain installed in /Users/johnhenry/valcuqw/vendor/bundle/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/johnhenry/valcuqw/vendor/bundle/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out

An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.

In the GEMFILE, I changed to gem "nokogiri", "~> 1.5.6”, but it told me that

bundle install
Gemfile syntax error:
gem "zip-zip", "~> 0.1" # In Gem hell...

I am totally frustrated. Can someone give me a hand? Thanks!

user2668789
  • 211
  • 1
  • 2
  • 10

2 Answers2

0

Could possibly be because of the weird " symbol you have in the gemfile. See the last character in the nokogiri line?

Max Woolf
  • 3,988
  • 1
  • 26
  • 39
  • Yeah, that is a problem. But after I corrected it and install nokogiri 1.5.6, it showed johnhenytekimbp:valcuqw johnhenry$ gem install nokogiri -v '1.5.6' ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/johnhenry/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.6/.autotest johnhenytekimbp:valcuqw johnhenry$ – user2668789 Oct 31 '13 at 13:56
  • `sudo gem install nokogiri -v '1.5.6'` – Roman Kiselenko Oct 31 '13 at 13:57
  • But it showed ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /Users/johnhenry/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb checking for libxml/parser.h... no ----- libxml2 is missing. – user2668789 Oct 31 '13 at 14:04
  • now try [this](http://stackoverflow.com/questions/6277456/nokogiri-installation-fails-libxml2-is-missing) – Roman Kiselenko Oct 31 '13 at 14:05
  • Thanks. but when I run bundle exec rails c, it still showed me an error like this:`require': cannot load such file -- nokogiri/nokogiri (LoadError) – user2668789 Oct 31 '13 at 14:29
0

I deleted the file: Gemfile.lock and had a continious loop of dots,so i restored it after quiting the process with ctrl + c ,so i went into the gemfile.lock file and manually picked the version of nokogiri i wanted,in my case 1.6.2.1, but i used nokogiri (~> 1.6.2), hope this works for someone

knaija
  • 34
  • 4