简体   繁体   中英

Rails App Failing to Push to Heroku Could not find rake-10.4.2

working through Hart's rails tutorial, and can't get past this error:

remote:        Your Gemfile has no gem server sources. If you need gems that are not already on
remote:        your machine, add a line like this to your Gemfile:
remote:        source 'https://rubygems.org'
remote:        Could not find rake-10.4.2 in any of the sources
remote:        Bundler Output: Your Gemfile has no gem server sources. If you need gems that are not already on
remote:        your machine, add a line like this to your Gemfile:
remote:        source 'https://rubygems.org'
remote:        Could not find rake-10.4.2 in any of the sources

but I definitely have Rake installed, and source ' https://rubygems.org ' in my Gemfile

Here is my Gemfile:

source 'https://rubygems.org'

gem 'rails',                '4.2.0.rc3'
gem 'sass-rails',           '5.0.0.beta1'
gem 'uglifier',             '2.5.3'
gem 'coffee-rails',         '4.1.0'
gem 'jquery-rails',         '4.0.0.beta2'
gem 'turbolinks',           '2.3.0'
gem 'jbuilder',             '2.2.3'
gem 'sdoc',                 '0.4.0', group: :doc

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
end

Any ideas?

I completed the michael hartl tutorial and my gemlike looks like this:

source 'https://rubygems.org'

gem 'rails',                   '4.2.0.beta4'
gem 'bcrypt',                  '3.1.7'
gem 'faker',                   '1.4.2'
gem 'carrierwave',             '0.10.0'
gem 'mini_magick',             '3.8.0'
gem 'fog',                     '1.23.0'
gem 'will_paginate',           '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass',          '3.2.0.0'
gem 'sass-rails',              '5.0.0.beta1'
gem 'uglifier',                '2.5.3'
gem 'coffee-rails',            '4.0.1'
gem 'jquery-rails',            '4.0.0.beta2'
gem 'turbolinks',              '2.3.0'
gem 'jbuilder',                '2.2.3'
gem 'rails-html-sanitizer',    '1.0.1'
gem 'sdoc',                    '0.4.0', group: :doc

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'unicorn',        '4.8.3'
end

Try adding the unicorn gem into production.

I had this same problem. It turned out to be because I was using ruby 1.9.3, and by default heroku is using 2.x. The resolution is to specify your ruby version explicitly in your Gemfile, by adding the following line:

ruby "1.9.3"

After committing and pushing, it worked perfectly.

See https://devcenter.heroku.com/articles/ruby-versions for details on specifying your ruby version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM