简体   繁体   中英

running rails server gives error can not load such a file — nokogiri/nokogiri

I am new in ROR When I want to run rails s, it gives me the above error, I already install gem nokogiri and bundle but still same problem exists. I use windows 7. I use ruby version 2.2.2 and rails 4.2.4

   C:\sites\simple_cms>rails s
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x64-       mingw32/lib/nokogiri
 .rb:29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x64-mingw32
/lib/nokogiri.rb:29:in `rescue in <top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x64-mingw32
/lib/nokogiri.rb:25:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah.rb:3
:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah.rb:3
:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.2/l
ib/rails-html-sanitizer.rb:2:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.0.2/l
ib/rails-html-sanitizer.rb:2:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
view/helpers/sanitize_helper.rb:3:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
 view/helpers/sanitize_helper.rb:3:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
 view/helpers/text_helper.rb:32:in `<module:TextHelper>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
  view/helpers/text_helper.rb:29:in `<module:Helpers>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
 view/helpers/text_helper.rb:6:in `<module:ActionView>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
 view/helpers/text_helper.rb:4:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
 view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
  view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
   view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
   view/helpers/form_tag_helper.rb:6:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
  view/helpers/form_helper.rb:4:in `require'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_
    view/helpers/form_helper.rb:4:in `<top (required)>'
    from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_

    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Nokogiri doesn't support Ruby 2.2 on windows.

See this answer.

Also check this for more assistance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM