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.
Related
I am getting this error while pushing code on heroku
git push Heroku master
i am getting this error
remote: Tasks: TOP => assets:precompile => css:build
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to openlibrarytaskcraft.
remote:
To https://git.heroku.com/openlibrarytaskcraft.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/openlibrarytaskcraft.git'
I tried precompiling assets by
*rails assets:precompile*
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.73s.
yarn run v1.22.17
error Command "build:css" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rails aborted!
cssbundling-rails: Command css:build failed, ensure yarn is installed and `yarn build:css` runs without errors
/home/azhar/.rvm/gems/ruby-2.6.5/gems/cssbundling-rails-1.0.0/lib/tasks/cssbundling/build.rake:5:in `block (2 levels) in <main>'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/railties-6.0.4.4/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/railties-6.0.4.4/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/railties-6.0.4.4/lib/rails/command.rb:48:in `invoke'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/railties-6.0.4.4/lib/rails/commands.rb:18:in `<main>'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/azhar/.rvm/gems/r**strong text**uby-2.6.5/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/azhar/Project/Open_library/bin/rails:9:in `<top (required)>'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
/home/azhar/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
/home/azhar/Project/Open_library/bin/spring:15:in `require'
/home/azhar/Project/Open_library/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => assets:precompile => css:build
(See full trace by running task with --trace)
***it says unable to find css:build***
**Even I added this by searching on Github**
config.assets.initialize_on_precompile = false
please check here is my Gemfile:-
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.0.4', '>= 6.0.4.4'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3', '~> 1.4'
gem "pg"
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# 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.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
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', '>= 3.3.0'
gem 'listen', '~> 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'
gem 'selenium-web driver
# 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 'devise'
gem 'cssbundling-rails'
gem 'mini_magick', '>= 4.9.5'
gem 'carrierwave', '~> 0.9'
gem 'bootstrap-sass','~> 2.3.2'
gem 'activeadmin'
I have downgraded the Heroku version from 20 to 18 which supports ruby v 2.6.5
I am trying to develop an open library demo project and want to push it to heroku using git
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!
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
I am new to Ruby on Rails and I am faced with an error message every time I push my git files to Heroku.
The steps I have taken are:
heroku login
heroku keys:add
heroku create
git push heroku master
The error message is as follows:
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: ! rake aborted!
Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to project1-app.
remote:
To https://git.heroku.com/project1-app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project1-app.git'
Gem file:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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
# 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
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
It looks like you have not updated your bundle may be after some editing in gem file. In order to make your bundle up-to date with your current gem file run below command
(1) bundle install
(2) bundle update
once your bundle is updated you can run
(3) heroku login
(4) heroku create
(5) git add .
(6) git commit -am "some comment"
(7) git push heroku master
(8) heroku open
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.