Question

Nokogiri isn't installing even though it's listed in the Gemfile. Help?

[root@mongo p]# cat Gemfile
source 'http://rubygems.org'

gem 'rails', '3.2.12'
gem 'mysql2'
gem 'jquery-rails'


# ============================
# Gems
# ============================
gem 'whois'
gem 'nokogiri'
gem 'bson_ext'
gem 'bson'
gem 'newrelic_rpm'
gem 'rpm_contrib'
gem 'savon'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end


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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end



[root@mongo p]# bundle install
Using rake (10.1.0)
Using i18n (0.6.4)
Using multi_json (1.7.7)
Using activesupport (3.2.12)
Using builder (3.0.4)
Using activemodel (3.2.12)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.12)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.4.4)
Using actionmailer (3.2.12)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.12)
Using activeresource (3.2.12)
Using gyoku (1.0.0)
Using akami (1.2.0)
Using bson (1.9.0)
Using bson_ext (1.9.0)
Using coffee-script-source (1.6.2)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.8.0)
Using rdoc (3.12.2)
Using thor (0.18.1)
Using railties (3.2.12)
Using coffee-rails (3.2.2)
Using httpi (2.0.2)
Using jquery-rails (3.0.1)
Using mysql2 (0.3.11)
Using newrelic_rpm (3.6.4.122)
Using nori (2.1.0)
Using bundler (1.3.1)
Using rails (3.2.12)
Using rpm_contrib (2.1.11)
Using sass (3.2.9)
Using sass-rails (3.2.6)
Using wasabi (3.1.0)
Using savon (2.2.0)
Using uglifier (2.1.1)
Using whois (3.1.3)
Your bundle is complete! It was installed into ./vendor/bundle
Was it helpful?

Solution

Please at first remove Gemfile.lock file to make sure that bundle rebuild all dependencies, and install all gem as for a first time, and recreate the file, then:

$ bundle install

Please verify, that the nokogiri gem has presented in the Gemfile.lock. Then to make sure that the nokogiri gem is properly installed type:

$ bundle show nokogiri
/path/to/nokogiri/gem

I above command shows an error others to Could not find gem 'nokogiri' that means that the setup of your systems is incorrect. So please don't use root account, and use simple user as holder of the project. And to separate project gem versions from each other use rvm to install gems into its gemsets as it has been written here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top