即使Nokogiri在Gemfile中列出,它也不会安装。帮助
[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
答案 0 :(得分:0)
请先删除 Gemfile.lock 文件以确保捆绑包重建所有依赖项,并首次安装所有gem,然后重新创建该文件:
$ bundle install
请确认 nokogiri gem已在 Gemfile.lock 中显示。然后确保 nokogiri gem正确安装类型:
$ bundle show nokogiri
/path/to/nokogiri/gem
我上面的命令显示错误其他人无法找到gem'nokogiri',这意味着您的系统设置不正确。所以请不要使用root帐户,并使用简单的用户作为项目的持有者。并且将项目gem版本彼此分开使用rvm
将gems安装到其gemsets中,因为它已经写成here。