'require': cannot load such file — 'nokogiri\nokogiri' (LoadError) when running `rails server`

后端 未结 4 1235
忘掉有多难
忘掉有多难 2020-11-27 03:07

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 ser         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 03:43

    1. First, uninstall the version of Nokogiri you currently have with:

      gem uninstall nokogiri
      
    2. Download Nokogiri 1.6.6.2 (x64) or Nokogiri 1.6.6.2 (x86)

    3. 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.

提交回复
热议问题