Maxence
Maxence

Reputation: 2339

Nokogiri error install

I am currently trying to upgrade an existing app from Rails 4.2.3 to Rails 5. then I followed this tutorial : http://railsapps.github.io/updating-rails.html

It recommends having RVM as Ruby version manager as well as gemsets manager. I am under windows 10 and because I couldn't find an easy solution to get RVM I have URU instead.

Well, no big deal. I have installed URU as well as another Ruby version enabling Rails 5 (Ruby 2.2.6)

Though, as mentionned below in the tutorial I have also tried to install nokogiri through command prompt:

gem install nokogiri

It failed with the following :

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri
-1.6.8.1-x86-mingw32/lib/nokogiri/2.2/nokogiri.so

Well I wasn't really bothered and decided to go on.. Though now every bundle install fails too !! But I dont even have any reference to nokogiri in my gemfile. (It is though in my gemfile.lock but if I try to remove it, I get a corrupt gemfile.lock error)

a bundle show gives the following:

Gems included by the bundle:
Your bundle is locked to nokogiri (1.6.8.1-x86-mingw32), but that version could
not be found in any of the sources listed in your Gemfile. If you haven't
changed sources, that means the author of nokogiri (1.6.8.1-x86-mingw32) has
removed it. You'll need to update your bundle to a different version of nokogiri
(1.6.8.1-x86-mingw32) that hasn't been removed in order to install.

Any easy solution to this ?

Upvotes: 1

Views: 2951

Answers (1)

Aniket Tiwari
Aniket Tiwari

Reputation: 4008

Delete your path folder(if it shows) and your Gemfile.lock . Then place this in your gem file

 gem 'nokogiri', '~> 1.6', '>= 1.6.8.1'

After that run bundle install .Remove the nokogiri from your gemfile

Upvotes: 1

Related Questions