I'm running a clean install of Ruby 2.2.1 on Windows 8.1 with DevKit. After the installation I run:
gem install rails rails new testapp cd testapp rails server leaving everything else at default.
The process fails at the last line when, instead of running the server, I get the error message
in 'require': cannot load such file -- 'nokogiri\nokogiri' (LoadError) It happens every time and I've looked around and tried everything I found to fix it, but nothing so far has worked.
What is the problem here and how do I get a simple test Rails app to work?
First, uninstall the version of Nokogiri you currently have with:
gem uninstall nokogiri Download Nokogiri 1.6.6.2 (x64) or Nokogiri 1.6.6.2 (x86)
Install this version locally using:
gem install --local C:\Users\$user$\Downloads\nokogiri-1.6.6.2-x64-mingw32.gem or if you're running 32bit Ruby:
gem install --local C:\Users\$user$\Downloads\nokogiri-1.6.6.2-x86-mingw32.gem The path may differ depending on where you downloaded the file to.
Try to start the server again using ruby bin\rails server, and it should work.
Nokogiri doesn't support Ruby 2.2 on Windows yet. The next release will. See https://github.com/sparklemotion/nokogiri/issues/1256
Nokogiri doesn't support native builds (e.g. with devkit) on Windows. Instead it provides gems containing prebuilt DLLs.
There's a discussion which you may want to join or watch on the topic of devkit build support here: https://github.com/sparklemotion/nokogiri/issues/1190
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With