我的Gemfile出了什么问题?

时间:2013-04-20 02:54:25

标签: ruby-on-rails ruby-on-rails-3.2 bundler gemfile

我尝试捆绑安装,但这是我得到的:

/home/mywebsite/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/version.rb:187:in `initialize': Malformed version number string = 1.0.3 (ArgumentError)
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:104:in `new'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:104:in `parse_spec'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:71:in `parse_source'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:30:in `block in initialize'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:24:in `each'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/lockfile_parser.rb:24:in `initialize'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/definition.rb:44:in `new'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/definition.rb:44:in `initialize'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/dsl.rb:148:in `new'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/dsl.rb:148:in `to_definition'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/dsl.rb:8:in `evaluate'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/definition.rb:18:in `build'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler.rb:144:in `definition'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/cli.rb:228:in `install'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/vendor/thor/task.rb:27:in `run'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/vendor/thor.rb:275:in `dispatch'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/vendor/thor/base.rb:408:in `start'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/bin/bundle:14:in `block in <top (required)>'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/gems/bundler-1.2.3/bin/bundle:14:in `<top (required)>'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/bin/bundle:19:in `load'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@global/bin/bundle:19:in `<main>'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@mywebsiter/bin/ruby_noexec_wrapper:14:in `eval'
       /home/mywebsite/.rvm/gems/ruby-1.9.3-p362@mywebsiter/bin/ruby_noexec_wrapper:14:in `<main>'
There was an error in your Gemfile, and Bundler cannot continue.

修改 这是我的Gemfile:

source 'https://rubygems.org'


gem 'rails', '3.2.11'

gem 'rake' , '>= 10.0.1'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem "rmagick", "~> 2.13.1"
gem "paperclip", "~> 3.0"
gem 'aws-sdk'
gem "fog"

gem 'bootstrap-wysihtml5-rails', :require => 'bootstrap-wysihtml5-rails',
    :git => 'git://github.com/Nerian/bootstrap-wysihtml5-rails.git'

#gem "asset_sync"

#gem 'sendgrid'
gem "tweet-button"
#gem "fb-localizer"

#gem 'easy_roles'

gem 'pg'
gem 'google-analytics-rails'
gem 'jquery-rails-cdn'
gem 'spinjs-rails'
# 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', :platform => :ruby
  gem 'less-rails-bootstrap'
  gem 'uglifier', '>= 1.0.3'
end


gem 'devise'

gem 'omniauth', "1.1.1"
gem 'omniauth-facebook', '1.4.0' # HIGHER VERSIONS DO NOT WORK!
gem "koala", "~> 1.5.0"
gem 'oauth2'

gem 'cancan'
gem 'routing-filter'




gem 'thin'
gem "simple_form"
gem "cocoon"
gem "jquery-rails"
gem "validate_url"
gem 'haml'

gem "on_the_spot"
gem 'therubyracer'   # important for less
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

#gem 'dragonfly'
gem 'refinerycms-i18n'#, '~> 2.1.0.dev', :git => 'git://github.com/refinery/refinerycms-i18n.git'
gem "refinerycms-videojs", "~> 0.5.5"
#Refinery
gem 'refinerycms-core' #You can leave this out if you like. It's a dependency of the other engines.
gem 'refinerycms-dashboard'
gem 'refinerycms-images'
gem 'refinerycms-pages'
gem 'refinerycms-resources'




group :production do
  gem 'newrelic_rpm'
end


#gem "ckeditor"
#gem "carrierwave"
#gem "mini_magick"

group :test, :development do

  gem "letter_opener"

  gem 'meta_request', '0.2.0'

  gem "rspec-rails", '2.9.0'

  gem 'guard-rspec'
  gem "spork"
  gem 'guard-spork'

  gem 'rb-inotify', '~> 0.8.8'

  gem "factory_girl_rails"

  gem "mocha"
  gem 'capybara' #, :git => 'git://github.com/jnicklas/capybara.git'

  gem 'launchy'
  gem "capybara-webkit"

  gem "nifty-generators"

  gem 'sextant'

  gem 'haml-rails'
  gem 'hpricot'
  gem 'ruby_parser'

end

#gem "paypal-recurring"
#gem "r2", "~> 0.0.3"

EDIT2

mywebsite@ubuntu:~/RubymineProjects/mywebsite$ bundle -v
Bundler version 1.2.3
mywebsite@ubuntu:~/RubymineProjects/mywebsite$ gem -v
1.8.24
mywebsite@ubuntu:~/RubymineProjects/mywebsite$ 

注意错误:

Malformed version number string = 1.0.3 (ArgumentError)

2 个答案:

答案 0 :(得分:5)

尝试删除Gemfile.lock并再次运行bundle install。

答案 1 :(得分:0)

尝试更改此内容:

'uglifier', '>= 1.0.3' 

为:

gem 'uglifier'#, '>= 1.0.3'

......看看会发生什么?