`bundle install`并收到消息错误消息

时间:2014-10-16 15:09:46

标签: ruby-on-rails ruby

我新的rails framework bundle install并获得了消息

/usr/lib/ruby/1.9.1/rubygems/requirement.rb:81:in `parse': Illformed requirement ["1.6.3.1 ruby java x64-mingw32 x86-mingw32"] (ArgumentError)
   /usr/lib/ruby/1.9.1/rubygems/requirement.rb:106:in `block in initialize'
   /usr/lib/ruby/1.9.1/rubygems/requirement.rb:106:in `map!'
   /usr/lib/ruby/1.9.1/rubygems/requirement.rb:106:in `initialize'
   /usr/lib/ruby/1.9.1/rubygems/requirement.rb:44:in `new'
   /usr/lib/ruby/1.9.1/rubygems/requirement.rb:44:in `create'
   /usr/lib/ruby/1.9.1/rubygems/dependency.rb:50:in `initialize'
   /usr/lib/ruby/vendor_ruby/bundler/dependency.rb:31:in `initialize'
   /usr/lib/ruby/vendor_ruby/bundler/dsl.rb:75:in `new'
   /usr/lib/ruby/vendor_ruby/bundler/dsl.rb:75:in `gem'
   /home/kn3l/workspace/railsprojects/mongkhut/Gemfile:40:in `eval_gemfile'
   /usr/lib/ruby/vendor_ruby/bundler/dsl.rb:30:in `instance_eval'
   /usr/lib/ruby/vendor_ruby/bundler/dsl.rb:30:in `eval_gemfile'
   /usr/lib/ruby/vendor_ruby/bundler/dsl.rb:9:in `evaluate'
   /usr/lib/ruby/vendor_ruby/bundler/definition.rb:19:in `build'
   /usr/lib/ruby/vendor_ruby/bundler.rb:148:in `definition'
   /usr/lib/ruby/vendor_ruby/bundler/cli.rb:245:in `install'
   /usr/lib/ruby/vendor_ruby/thor/command.rb:27:in `run'
   /usr/lib/ruby/vendor_ruby/thor/invocation.rb:120:in `invoke_command'
   /usr/lib/ruby/vendor_ruby/thor.rb:363:in `dispatch'
   /usr/lib/ruby/vendor_ruby/thor/base.rb:439:in `start'
   /usr/bin/bundle:20:in `block in <main>'
   /usr/lib/ruby/vendor_ruby/bundler/friendly_errors.rb:3:in `with_friendly_errors'
   /usr/bin/bundle:20:in `<main>'

我的Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# 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'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

gem 'nokogiri', '1.6.3.1 ruby java x64-mingw32 x86-mingw32'

您的Gemfile出错,Bundler无法继续。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

这一行:
gem 'nokogiri', '1.6.3.1 ruby java x64-mingw32 x86-mingw32'
使用版本为“1.6.3.1 ruby​​ java x64-mingw32 x86-mingw32”的捆绑包查找nokogiri,这不是有效版本。

我猜你想要版本“1.6.3.1”,在平台上ruby,java,x64-mingw32和x86-mingw32,它们将被指定为gem 'nokogiri', '1.6.3.1', platforms: %i(ruby java x64-mingw32 x86-mingw32)

除此之外,java,x64-mingw32和x86-mingw32都不是有效的平台,你的意思是jruby和mingw吗?