Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Nokogiri不作为宝石安装,即使它';在GEM文件中列出了_Ruby On Rails_Rubygems_Gem_Bundler_Gemfile - Fatal编程技术网

Ruby on rails Nokogiri不作为宝石安装,即使它';在GEM文件中列出了

Ruby on rails Nokogiri不作为宝石安装,即使它';在GEM文件中列出了,ruby-on-rails,rubygems,gem,bundler,gemfile,Ruby On Rails,Rubygems,Gem,Bundler,Gemfile,Nokogiri没有安装,即使文件中列出了它。帮忙 [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'

Nokogiri没有安装,即使文件中列出了它。帮忙

[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

请首先删除Gemfile.lock文件以确保捆绑包重建所有依赖项,并首次安装所有gem as,然后重新创建文件,然后:

$ bundle install
请验证nokogiri gem是否已显示在Gemfile.lock中。然后,为确保nokogiri gem安装正确,请键入:

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

上面的I命令显示了一个错误,其他人无法找到gem'nokogiri',这意味着您的系统设置不正确。所以请不要使用根帐户,而使用简单用户作为项目的持有者。要将project gem版本彼此分离,请使用
rvm
将gems安装到其编写的gems中。

删除Gemfile.lock并重试,请不要使用root帐户,使用
rvm
将gems安装到gems删除Gemfile.lock没有帮助。。。其他建议?谢谢bundler再次创建了Gemfle.lock,请验证其中是否有nokogiri gem?是的gem列在Gemfile.lock中