Having Trouble to deploy a Rails App to Heroku - ruby-on-rails

I'm having trouble to deploy a rails app to Heroku. Heroku is giving me the Error Message An error occurred while installing Ruby ruby-2.1.1 which is confusing me after all that I've done to set everything to ruby 2.0.0.
Any Ideas? Thanks!
My Steps so far:
I searched here https://devcenter.heroku.com/articles/ruby-support#supported-runtimes for a ruby version that is currently compatible.
I Installed the Version Ruby 2.0.0 via RVM on my Computer
I made sure that this version is used: rvm use ruby-2.0.0
I added the line ruby '2.0.0' to the App's Gemfile
I did run bundle install (No Error Messages)
I did run git push heroku master
The Heroku Errormessage:
> ~/Desktop/blog(heroku_deploy) git push heroku master
Counting objects: 61, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (61/61), 14.77 KiB | 0 bytes/s, done.
Total 61 (delta 26), reused 41 (delta 7)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Removing .DS_Store files
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: !
remote: ! An error occurred while installing Ruby ruby-2.1.1
remote: ! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: ! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
remote: ! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.1.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote: !
remote: ! gzip: stdin: unexpected end of file
remote: ! tar: Child returned status 1
remote: ! tar: Error is not recoverable: exiting now
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to quiet-springs-8925.
remote:
To https://git.heroku.com/quiet-springs-8925.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/quiet-springs-8925.git'
The Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
ruby '2.0.0'
gem 'rails', '4.1.5'
gem 'bcrypt', '3.1.7'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
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 'puma', '2.11.1'
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]

Heroku doesn't support Ruby 2.1.1. Like it says in the errors, you can find which ruby runtimes work here.
Quick look at the Ruby runtimes that work gives: 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.6, 2.2.2.

Related

rails cannot load such file -- rake (LoadError)

I want to push my first application in Heroku, but my push failed. I have this error in my shell;
Bundle completed (197.95s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
remote: Detected manifest file, assuming assets were compiled locally
remote: -----> Detecting rails configuration
remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! /tmp/build_edcc391d/bin/rake:4:in `require': cannot load such file -- rake (LoadError)
remote: ! from /tmp/build_edcc391d/bin/rake:4:in `<main>'
remote: !
remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: /tmp/build_edcc391d/bin/rake:4:in `require': cannot load such file -- rake (LoadError)
remote: from /tmp/build_edcc391d/bin/rake:4:in `<main>'
remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1106:in `rake'
remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:85:in `has_jobs_work_task?'
bla bla bla
So, this is my Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.0'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
#gem 'bootsnap', '>= 1.5.1', require: true
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'faker'
gem 'table_print'
gem 'bootstrap'
gem 'jquery-rails'
gem 'rake'
gem 'rack-timeout'
I think I tried everything. Here is what I tried for resolve this error;
add gem 'rake' and gem 'rack-timeout' in my Gemfile
bundle install
git commit -m "Modified Gemfile.lock"
add RAILS_SERVE_STATIC_FILES env. to yr server.
RAILS_ENV=production bundle exec rake assets:precompile
(If I run RAILS_ENV=production bundle exec rake assets:precompile, I have this)
sh: /Users/mac/Library/Mobile: No such file or directory
sh: /Users/mac/Library/Mobile: No such file or directory
Warning: you are using an unstable release of Node.js (v15.4.0). If you encounter issues with Node.js, consider switching to an Active LTS release. More info: https://docs.npmjs.com/try-the-latest-stable-version-of-node
Everything's up-to-date. Nothing to do
git add public/assets
git commit -m "vendor compiled assets"
...
But nothing, I have this error again and again ...
If anyone can help me I will be very grateful.
Thank you.
Could you please share your Gemfile.lock?
I faced the same problem and solved it by changing PLATFORMS from x86_64-darwin-19 to ruby.

Heroku push rejected, failed to install gems via Bundler #2

I'm new to ruby on rails and working on a project on AWS cloud9. I went through other posts on stackoverflow but still couldn't find the solution to solve the error below. I have tried bundle install, bundle update, git add Gemfile.lock, none of them worked for me.
ec2-user:~/environment/saasapp (master) $ git push heroku master
Counting objects: 7991, done.
Compressing objects: 100% (6447/6447), done.
Writing objects: 100% (7991/7991), 48.09 MiB | 47.95 MiB/s, done.
Total 7991 (delta 1044), reused 7778 (delta 967)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.4.1
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find pg-0.18.4 in any of the sources
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find pg-0.18.4 in any of the sources
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to radiant-tor-65852.
remote:
To https://git.heroku.com/radiant-tor-65852.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/radiant-tor-65852.git'
Here is the gem file:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.4.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.3'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
# Use Twitter Bootstrap library for front-end UI and layout
gem 'bootstrap-sass', '3.3.7'
# Use Font Awesome sass gem for adding icons
gem 'font-awesome-sass', '~> 5.0.13'
# Use Hirb for better db display in console
gem 'hirb', '0.7.3'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :production do
# Use the PostgreSQL gem for heroku production servers
gem 'pg', '~> 0.20.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
OK, I got the solution.
First, type this command line:
sudo yum install /usr/include/libpq-fe.h
Then:
bundle install --with production
Worked for me!

push rails app to heroku fails in bundle supports no platform

when I push my rails-app to heroku it fails at the bundling step because it doesn't match the platform. I tried to change or remove the ruby tag from Gemfile but it doesn't change anything. It fails because my bundle does not support any platform [] (guess should be ruby in there).
git push heroku master
Counting objects: 19, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (19/19), 2.96 KiB | 0 bytes/s, done.
Total 19 (delta 5), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby
remote: -----> Using Ruby version: ruby-2.3.7
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Your bundle only supports platforms [] but your local platforms are ["ruby",
remote: "x86_64-linux"], and there's no compatible match between those two lists.
remote: Bundler Output: Your bundle only supports platforms [] but your local platforms are ["ruby",
remote: "x86_64-linux"], and there's no compatible match between those two lists.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to evening-brushlands-95986.
remote:
To https://git.heroku.com/evening-brushlands-95986.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/evening-brushlands-95986.git'
On my local machine it satisfies the platform
bundle platform
Your platform is: x86_64-linux
Your app has gems that work on these platforms:
* ruby
Your Gemfile specifies a Ruby version requirement:
* ruby 2.5.0p0
Your current platform satisfies the Ruby version requirement.
Even if I specify a ruby 2.5 in my Gemfile, heroku uses ruby-2.3.7
my Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
# gem 'byebug', platforms: [:ruby, :mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'administrate', '~> 0.10.0'
gem 'data-confirm-modal', '~> 1.6.2'
gem 'devise', '~> 4.4.3'
gem 'devise-bootstrapped', github: 'excid3/devise-bootstrapped', branch: 'bootstrap4'
gem 'devise_masquerade', '~> 0.6.0'
gem 'font-awesome-sass', '~> 4.7'
gem 'gravatar_image_tag', github: 'mdeering/gravatar_image_tag'
gem 'jquery-rails', '~> 4.3.1'
gem 'bootstrap', '~> 4.0.0.beta'
gem 'mini_magick', '~> 4.8'
gem 'webpacker', '~> 3.4'
gem 'sidekiq', '~> 5.0'
gem 'foreman', '~> 0.84.0'
gem 'omniauth-facebook', '~> 4.0'
gem 'omniauth-twitter', '~> 1.4'
gem 'omniauth-github', '~> 1.3'
gem 'whenever', require: false
gem 'friendly_id', '~> 5.1.0'
gem 'sitemap_generator', '~> 6.0', '>= 6.0.1'
anyone had this before?
regards Kai
#toy I think some of the gem dependencies problems. Either you can remove the Gemfile.lock and do bundle install then commit and push or do bundle update then commit and push along with the Gemfile.lock
1) Remove Gemfile.lock
2) bundle install
3) git add Gemfile.lock
4) git commit -m 'Gemfile.lock added'
5) git push heroku master
OR
1) bundle update
2) git add Gemfile.lock
3) git commit -m 'Gemfile.lock added'
4) git push heroku master

Deploying Ruby on Rails app to Heroku rejected saying default language pack not detected

Here is the terminal result: So the error with language detention problem is with the command "$ git push heroku master"
tom100j:~/workspace/hello_app (master) $ git push heroku master
Counting objects: 133, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (118/118), done.
Writing objects: 100% (133/133), 24.39 KiB | 0 bytes/s, done.
Total 133 (delta 27), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect
the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to murmuring-stream-98615.
remote:
To https://git.heroku.com/murmuring-stream-98615.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/murmuring-stream-98615.git'
tom100j:~/workspace/hello_app (master) $
I have tried to go through what the problem is and even change the version of the ruby in the app. The gemfile is below.
source 'https://rubygems.org'
ruby "2.3.0"
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'rails', '~> 5.0.1'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test doconsole
gem 'sqlite3', '1.3.12'
gem 'byebug', platform: :mri
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby, :ruby]
group :production do
gem 'pg', '0.18.4'
end
Anybody hot solution for this?
Heroku couldn't detect the buildpack your application needs
Buildpacks are responsible for transforming deployed code into a slug, which can then be executed on a dyno.
First you should check if there's any buildpack set for the app by running, if theres none you should see the following message
$ heroku buildpacks
APP_NAME has no Buildpack URL set.
If there's a buildpack already selected you could remove it by issueing
$ heroku buildpacks:clear
Then manually set the buildpack for the application by running
$ heroku buildpacks:set heroku/ruby
Try to push the app again. If it continues to fail you should check
that the Gemfile.lock file contains a railties gem, and the gem version is greater than or equal to 5.0.0.beta, and less than 6.0.0. As suggested by Heroku Ruby Support for Rails 5.x applications

Git pushing to Heroku raises a Bundler error

I'm trying to get an old Heroku app running, failing so far. $ heroku stack returns
=== <app_name> Available Stacks
bamboo-ree-1.8.7
cedar
* bamboo-mri-1.9.2 (prepared, will migrate on next git push)
and when pushing, I get the following:
$ git push heroku master
Counting objects: 48, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 4.00 KiB, done.
Total 31 (delta 18), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
/tmp/build_3cljt2m8e8r7e/Gemfile:2:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0x00000003221778> (NoMethodError)
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/dsl.rb:7:in `instance_eval'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/dsl.rb:7:in `evaluate'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/definition.rb:17:in `build'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:128:in `definition'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
from /usr/ruby1.9.2/bin/bundle:19:in `load'
from /usr/ruby1.9.2/bin/bundle:19:in `<main>'
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
To git#heroku.com:<app_name>.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:<app_name>.git'
Current Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'bundler', '1.3.0.pre.8'
gem 'rails', '~> 3.2'
gem 'jquery-rails', '~> 2.2'
gem 'slim', '~> 1.3'
gem 'dynamic_form', '~> 1.0'
gem 'state_machine', '~> 1.1'
gem 'draper', '~> 1.1'
gem 'bcrypt-ruby', '~> 3.0', :require => 'bcrypt'
gem 'thin', '~> 1.5'
gem 'twitter-bootstrap-rails', '~> 2.2'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'less-rails', '~> 2.2'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', '~> 0.11', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
group :development do
gem 'sqlite3', '~> 1.3'
gem 'pry', '~> 0.9'
gem 'better_errors', '~> 0.3'
gem 'binding_of_caller', '~> 0.6'
end
group :production do
gem 'pg', '~> 0.14'
end
It seems there is an issue with Bundler, any ideas?
The problem is caused by the line 2 of Gemfile:
ruby '1.9.3'
From the output we can see the version of Bundler running:
Gemfile detected, running Bundler version 1.0.7
But ruby directive seems to be Bundler 1.2 feature and won't work with old Bundler. I think you can safely remove this ruby '1.9.3' line for now.
Of course, you have gem 'bundler', '1.3.0.pre.8' in your gemfile. But this is the chicken and egg problem: new Bundler will not be installed until Gemfile is parsed, but old Bundler cannot parse it.

Resources