简体   繁体   中英

How to fix `require': cannot load such file — nokogiri/2.1/nokogiri (LoadError)

I see many answers for this error when ruby version is =>2.2, but in my computer installed ruby version is [ruby 2.1.8p440] I get this error when starting a server ( rails server ).

Gemfile

    source 'http://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg', '0.18.2'
# Use SCSS for stylesheets
#gem 'sass-rails', '~> 4.0.3'

gem 'rails_12factor', group: :production


# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'sass-rails', '>= 3.3.4'
gem 'bootstrap-sass', '~> 3.3.6'

gem 'ckeditor', '4.1.6'
gem 'carrierwave', '0.10.0'
gem 'fog', '~> 1.3.1'
gem 'mini_magick', '4.5.1'
gem 'will_paginate', '3.1.0'
gem 'nokogiri', '>= 1.5.0'


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]

启动服务器时出错

您需要运行bundle (或bundle install ,但bundle做同样的事情),以安装应用程序运行所需的 gem。

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