bundle命令的Gemfile错误

Jac*_*cob 2 bundle heroku nomethoderror gemfile

我是应用程序的合作者,我克隆了,并且在我的协作者的计算机上一切都运行得很好.但是,当我在我的Heroku应用程序的根目录中键入bundle exec或bundle install时,出现以下错误:

/Users/jacob/furious-ocean-6331/Gemfile:3:in `evaluate': undefined method `ruby' for # <Bundler::Dsl:0x007fcda31048c0> (NoMethodError)
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/dsl.rb:7:in `instance_eval'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler1.1.4/lib/bundler/dsl.rb:7:in `evaluate'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/definition.rb:18:in `build'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler.rb:135:in `definition'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler1.1.4/lib/bundler/cli.rb:220:in `install'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler1.1.4/lib/bundler/vendor/thor/task.rb:22:in `run'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/vendor/thor.rb:263:in `dispatch'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/vendor/thor/base.rb:386:in `start'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/bin/bundle:13:in `<top (required)>'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/bin/bundle:19:in `load'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/bin/bundle:19:in `<main>'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
       /Users/jacob/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
There was an error in your Gemfile, and Bundler cannot continue.
Run Code Online (Sandbox Code Playgroud)

这是Gemfile:

source 'https://rubygems.org'

ruby '1.9.3'
gem 'rails', '3.2.2'

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

gem 'nokogiri'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem "json", "~> 1.7.3"

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

  gem 'uglifier', '>= 1.0.3'
end

gem 'thin'

gem "heroku"

gem 'jquery-rails'

group :development, :test do
    gem 'sqlite3'
end

group :production do
    gem 'pg'
end


# 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 'ruby-debug19', :require => 'ruby-debug'
Run Code Online (Sandbox Code Playgroud)

Joh*_*non 9

ruby您在Gemfile中拥有的元素仅适用于Bundler的预发布版本,请确保您这样做

gem install bundler --pre

确保你在bundler的预发布版本上运行,增加了对指定ruby版本的支持.