Heroku: Failed to install gems via Bundler - ruby-on-rails

I try to push my Rails app to Heroku using git push heroku master -f command and I get this:
Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.9.7
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote: You have added to the Gemfile:
remote: * rails (= 4.2.0)
remote: * sass-rails (= 5.0.2)
remote: * uglifier (= 2.5.3)
remote: * coffee-rails (= 4.1.0)
remote: * jquery-rails (= 4.0.3)
remote: * turbolinks (= 2.3.0)
remote: * jbuilder (= 2.2.3)
remote: * sdoc (= 0.4.0)
remote: * sqlite3 (= 1.3.9)
remote: * byebug (= 3.4.0)
remote: * web-console (= 2.0.0.beta3)
remote: * spring (= 1.1.3)
remote: * pg (= 0.17.1)
remote: * rails_12factor (= 0.0.2)
remote: You have deleted from the Gemfile:
remote: * byebug
remote: * coffee-rails (~> 4.1.0)
remote: * jbuilder (~> 2.0)
remote: * jquery-rails
remote: * rails (= 4.2.1)
remote: * sass-rails (~> 5.0)
remote: * sdoc (~> 0.4.0)
remote: * spring
remote: * sqlite3
remote: * turbolinks
remote: * uglifier (>= 1.3.0)
remote: * web-console (~> 2.0)
remote: Bundler Output: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: You have added to the Gemfile:
remote: * rails (= 4.2.0)
remote: * sass-rails (= 5.0.2)
remote: * uglifier (= 2.5.3)
remote: * coffee-rails (= 4.1.0)
remote: * jquery-rails (= 4.0.3)
remote: * turbolinks (= 2.3.0)
remote: * jbuilder (= 2.2.3)
remote: * sdoc (= 0.4.0)
remote: * sqlite3 (= 1.3.9)
remote: * byebug (= 3.4.0)
remote: * web-console (= 2.0.0.beta3)
remote: * spring (= 1.1.3)
remote: * pg (= 0.17.1)
remote: * rails_12factor (= 0.0.2)
remote:
remote: You have deleted from the Gemfile:
remote: * byebug
remote: * coffee-rails (~> 4.1.0)
remote: * jbuilder (~> 2.0)
remote: * jquery-rails
remote: * rails (= 4.2.1)
remote: * sass-rails (~> 5.0)
remote: * sdoc (~> 0.4.0)
remote: * spring
remote: * sqlite3
remote: * turbolinks
remote: * uglifier (>= 1.3.0)
remote: * web-console (~> 2.0)
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to theorderapp.
remote:
To https://git.heroku.com/theorderapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/theorderapp.git'
I try to bundle update and bundle install again and run git push heroku master -f but it's still not working.
I also try delete my Gemfile.lock file, run bundle update and bundle install again, git add and git commit it and run git push heroku master -f but it also not working for me.
This is my Gemfile btw:
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
gem 'font-awesome-sass'
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
And this is my .gitignore file:
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp

Follow steps -
Step 1: Remove Gemfile.lock from your project by manually or from following command -
rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock
Step 2: Then bundle install
Step 3: git add .
Step 4: git commit -m "commiting Gemfile.lock"
Step 5: git push heroku master -f

First do a "git pull" to merge, and then push again.
or try to Execute this:
rake assets:precompile
git add .
git commit -m "Add precompiled assets for Heroku"
git push heroku master -f

to make sure you have install posgresSQL on your local by:
on MAC:
brew install postgresql
on Ubuntu:
sudo apt-get install libpq-dev
RHEL systems:
yum install postgresql-devel
Start the postgres on your local
pg_ctl -D /usr/local/var/postgres start && brew services star postgresql
Let’s make sure Postgres is installed and running
postgres -V
Login to Postgresql on terminal
sudo -u postgres psql postgres
(You may need to provide the password 'root' )
Create user
Postgres doesn’t actually directly manage users or groups, like most standard permission models do. Instead, it directly manages what it calls roles
CREATE ROLE testpostgres WITH LOGIN PASSWORD 'root';
Assign createDB permission to our new user
ALTER ROLE testpostgres CREATEDB;
Set password for new user
\password testpostgres
Create your DB
CREATE DATABASE yourDBName;
Used Postico (eggerapps.at/postico/) with UI to manage PostgresDB.
User user setup above to login to your DB via Postico.
After logged in, you may see the image like below
enter image description here
Config your database.yml
Change all adapter :sqlite3 to adapter :postgresql
Provide the username and password login to DB by added two fields to your database.yml file like:
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: localhost
username: testpostgres
password: root
timeout: 5000
Fell free to put your DB name with the field database, like:
production:
<<: *default
database: railsapp
Run
rake db:create
rake db:migrate
Commit and push code to Heroku again. It should be Ok.
References links :
https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx

I'm pretty sure it's that you don't specify the ruby version in your gemfile. I believe Heroku needs this. So it's using ruby 2.0 as the heroku default and then trying to load gems for 1.9.7 as the bundler default.
If this is right, specifying the ruby version number in the gemfile will fix the problem. See http://devcenter.heroku.com/articles/ruby-versions

Related

Heroku rejecting my git push due to SQLite3

Heroku keeps rejecting my pushes with this error:
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
I realize this is a common problem (I have looked at other threads) I have tried removing the sqlite3 gem from my Gemfile, I ran a bundle install and made sure that the sqlite3 gem was also out of my Gemfile.lock (which it was).
I also got rid of all references to sqlite3 from my database.yml and replaced them with Postgres:
#
default: &default
adapter: postgresql
encoding: unicode
database: store_development
pool: 5
timeout: 5000
development:
adapter: postgresql
encoding: unicode
database: store_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: store_test
production:
adapter: postgresql
encoding: unicode
database: store_development
I'm lost any suggestions?
Here is my gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# 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'
#bcrypt for for encrpytion
gem 'bcrypt', '~> 3.1', '>= 3.1.11'
#byebug
gem 'byebug', '~> 9.0', '>= 9.0.5'
# 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
#paperclip for easy upload management
gem 'paperclip', '~> 4.3', '>= 4.3.6'
#bootstrap-sass
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
#searchkick
gem 'searchkick', '~> 1.2', '>= 1.2.1'
#paginate
gem 'will_paginate', '~> 3.1'
#paginate for bootstrap
gem 'bootstrap-will_paginate', '~> 0.0.10'
#Carrierwave
#gem 'carrierwave'
#Cloudinary
#gem 'cloudinary'
#Paperclip forcloudinary
gem 'paperclip-cloudinary'
#elasticsearch stuff
gem 'elasticsearch-rails'
gem 'elasticsearch-model'
#bonsi
gem 'bonsai-elasticsearch-rails', '~> 0.0.4'
group :development, :test do
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'
#db stuff
gem 'sqlite3'
end
group :production do
gem 'rails_12factor'
gem 'puma', '~> 3.4'
#postgresql
gem 'pg'
end
I'll also include the whole Heroku rejection just for reference:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rubygems.org/...
remote: Fetching dependency metadata from https://rubygems.org/..
remote: Using i18n 0.7.0
remote: Using rake 11.1.2
remote: Using json 1.8.3
remote: Using minitest 5.8.4
remote: Using thread_safe 0.3.5
remote: Using builder 3.2.2
remote: Using erubis 2.7.0
remote: Using mini_portile2 2.0.0
remote: Using rack 1.6.4
remote: Using mime-types-data 3.2016.0221
remote: Using arel 6.0.3
remote: Using execjs 2.6.0
remote: Using aws_cf_signer 0.1.3
remote: Using bcrypt 3.1.11
remote: Using bonsai-elasticsearch-rails 0.0.4
remote: Using sass 3.4.22
remote: Using will_paginate 3.1.0
remote: Using coffee-script-source 1.10.0
remote: Using thor 0.19.1
remote: Using concurrent-ruby 1.0.1
remote: Using orm_adapter 0.5.0
remote: Using multi_json 1.11.2
remote: Using multipart-post 2.0.0
remote: Using hashie 3.4.3
remote: Using elasticsearch-rails 0.1.9
remote: Using mimemagic 0.3.0
remote: Using pg 0.18.4
remote: Using bundler 1.11.2
remote: Using rails_serve_static_assets 0.0.5
remote: Using rails_stdout_logging 0.0.5
remote: Using tilt 2.0.2
remote: Using rdoc 4.2.2
remote: Using tzinfo 1.2.2
remote: Using nokogiri 1.6.7.2
remote: Using mime-types 3.0
remote: Using autoprefixer-rails 6.3.6
remote: Using uglifier 3.0.0
remote: Using rack-test 0.6.3
remote: Using warden 1.2.6
remote: Using bootstrap-will_paginate 0.0.10
remote: Using coffee-script 2.4.1
remote: Using sprockets 3.6.0
remote: Using elasticsearch-api 1.0.17
remote: Using faraday 0.9.2
remote: Using rails_12factor 0.0.3
remote: Using sdoc 0.4.1
remote: Using activesupport 4.2.5.1
remote: Using loofah 2.0.3
remote: Using mail 2.6.4
remote: Using rest-client 1.6.7
remote: Using bootstrap-sass 3.3.6
remote: Using elasticsearch-transport 1.0.17
remote: Using rails-deprecated_sanitizer 1.0.3
remote: Using globalid 0.3.6
remote: Using activemodel 4.2.5.1
remote: Using climate_control 0.0.3
remote: Using jbuilder 2.4.1
remote: Using rails-html-sanitizer 1.0.3
remote: Using cloudinary 1.2.0
remote: Using rails-dom-testing 1.0.7
remote: Using elasticsearch 1.0.17
remote: Using activejob 4.2.5.1
remote: Using cocaine 0.5.8
remote: Using paperclip-cloudinary 1.1.0
remote: Using actionview 4.2.5.1
remote: Using elasticsearch-model 0.1.9
remote: Using activerecord 4.2.5.1
remote: Using searchkick 1.2.1
remote: Using paperclip 4.3.6
remote: Using actionpack 4.2.5.1
remote: Using actionmailer 4.2.5.1
remote: Using railties 4.2.5.1
remote: Using sprockets-rails 3.0.4
remote: Using coffee-rails 4.1.1
remote: Using responders 2.1.2
remote: Using jquery-rails 4.1.1
remote: Using rails 4.2.5.1
remote: Using sass-rails 5.0.4
remote: Using turbolinks 2.5.3
remote: Using devise 4.0.0
remote: Installing sqlite3 1.3.11 with native extensions
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote: /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160801-197-lz2bsz.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers. Check the mkmf.log file for more details. You may
remote: need configuration options.
remote: Provided configuration options:
remote: --with-opt-dir
remote: --without-opt-dir
remote: --with-opt-include
remote: --without-opt-include=${opt-dir}/include
remote: --with-opt-lib
remote: --without-opt-lib=${opt-dir}/lib
remote: --with-make-prog
remote: --without-make-prog
remote: --srcdir=.
remote: --curdir
remote: --ruby=/tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-dir
remote: --without-sqlite3-dir
remote: --with-sqlite3-include
remote: --without-sqlite3-include=${sqlite3-dir}/include
remote: --with-sqlite3-lib
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote: extconf failed, exit code 1
remote: Gem files will remain installed in /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote: Results logged to /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote: Bundler Output: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rubygems.org/...
remote: Fetching dependency metadata from https://rubygems.org/..
remote: Using i18n 0.7.0
remote: Using rake 11.1.2
remote: Using json 1.8.3
remote: Using minitest 5.8.4
remote: Using thread_safe 0.3.5
remote: Using builder 3.2.2
remote: Using erubis 2.7.0
remote: Using mini_portile2 2.0.0
remote: Using rack 1.6.4
remote: Using mime-types-data 3.2016.0221
remote: Using arel 6.0.3
remote: Using execjs 2.6.0
remote: Using aws_cf_signer 0.1.3
remote: Using bcrypt 3.1.11
remote: Using bonsai-elasticsearch-rails 0.0.4
remote: Using sass 3.4.22
remote: Using will_paginate 3.1.0
remote: Using coffee-script-source 1.10.0
remote: Using thor 0.19.1
remote: Using concurrent-ruby 1.0.1
remote: Using orm_adapter 0.5.0
remote: Using multi_json 1.11.2
remote: Using multipart-post 2.0.0
remote: Using hashie 3.4.3
remote: Using elasticsearch-rails 0.1.9
remote: Using mimemagic 0.3.0
remote: Using pg 0.18.4
remote: Using bundler 1.11.2
remote: Using rails_serve_static_assets 0.0.5
remote: Using rails_stdout_logging 0.0.5
remote: Using tilt 2.0.2
remote: Using rdoc 4.2.2
remote: Using tzinfo 1.2.2
remote: Using nokogiri 1.6.7.2
remote: Using mime-types 3.0
remote: Using autoprefixer-rails 6.3.6
remote: Using uglifier 3.0.0
remote: Using rack-test 0.6.3
remote: Using warden 1.2.6
remote: Using bootstrap-will_paginate 0.0.10
remote: Using coffee-script 2.4.1
remote: Using sprockets 3.6.0
remote: Using elasticsearch-api 1.0.17
remote: Using faraday 0.9.2
remote: Using rails_12factor 0.0.3
remote: Using sdoc 0.4.1
remote: Using activesupport 4.2.5.1
remote: Using loofah 2.0.3
remote: Using mail 2.6.4
remote: Using rest-client 1.6.7
remote: Using bootstrap-sass 3.3.6
remote: Using elasticsearch-transport 1.0.17
remote: Using rails-deprecated_sanitizer 1.0.3
remote: Using globalid 0.3.6
remote: Using activemodel 4.2.5.1
remote: Using climate_control 0.0.3
remote: Using jbuilder 2.4.1
remote: Using rails-html-sanitizer 1.0.3
remote: Using cloudinary 1.2.0
remote: Using rails-dom-testing 1.0.7
remote: Using elasticsearch 1.0.17
remote: Using activejob 4.2.5.1
remote: Using cocaine 0.5.8
remote: Using paperclip-cloudinary 1.1.0
remote: Using actionview 4.2.5.1
remote: Using elasticsearch-model 0.1.9
remote: Using activerecord 4.2.5.1
remote: Using searchkick 1.2.1
remote: Using paperclip 4.3.6
remote: Using actionpack 4.2.5.1
remote: Using actionmailer 4.2.5.1
remote: Using railties 4.2.5.1
remote: Using sprockets-rails 3.0.4
remote: Using coffee-rails 4.1.1
remote: Using responders 2.1.2
remote: Using jquery-rails 4.1.1
remote: Using rails 4.2.5.1
remote: Using sass-rails 5.0.4
remote: Using turbolinks 2.5.3
remote: Using devise 4.0.0
remote: Installing sqlite3 1.3.11 with native extensions
remote:
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:
remote: /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160801-197-lz2bsz.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers. Check the mkmf.log file for more details. You may
remote: need configuration options.
remote:
remote: Provided configuration options:
remote: --with-opt-dir
remote: --without-opt-dir
remote: --with-opt-include
remote: --without-opt-include=${opt-dir}/include
remote: --with-opt-lib
remote: --without-opt-lib=${opt-dir}/lib
remote: --with-make-prog
remote: --without-make-prog
remote: --srcdir=.
remote: --curdir
remote: --ruby=/tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-dir
remote: --without-sqlite3-dir
remote: --with-sqlite3-include
remote: --without-sqlite3-include=${sqlite3-dir}/include
remote: --with-sqlite3-lib
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote:
remote: extconf failed, exit code 1
remote:
remote: Gem files will remain installed in /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote: Results logged to /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to professor-ratings.
remote:
Could the problem be with the build configuration? How can I change that?'
Using SQLITE3 is fine in development, Heroku just needs PG for production, your gemfile should look something like this:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
You may need to reset your database (rails db:reset / rake db:reset depending on rails version). Then you can just run bundle install --without production
I had the same problem, I achieve FIXED
Delete file "gemfile.lock"
Move "gem 'sqlite3'" into development group.
Add production group whit gem 'pg':
group :production do
gem 'pg'
end
then bundle
git add .
In console or command promt or CMD run:
heroku config:set BUNDLE_WITHOUT="development:test"
Dont forget commit.
And then, git push heroku master
GO SUCCESS!!
remote: ! Detected sqlite3 gem which is not supported on Heroku.
remote: ! https://devcenter.heroku.com/articles/sqlite3
Log it self say's sqlite3 is not supported on Heroku by default. by default Heroku use the postgres database.
Make sure your Gemfile contains gem 'pg' in production group and try again, it will surely work.
If you want to use sqlite3 on developmet then you have to do code as below in your Gemfile
#Gemfile
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: :production
Firstly makes sure you have added the following gems
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Next make sure you run bundle intsall
Now push your app to github git push origin master
Now your ready to push it into production git push heroku master
After you bundle install you need to make sure you pushed your app to github first (assuming your using github)
As they said you need to replace the gem, however gem pg won't work on windows because the latest version is buggy. So you need to do three things basically to push correctly to heroku.
1- add these two gems to your gemfile
group :production do
gem 'pg','~>0.19.0.pre20160409114042'
gem 'rails_12factor'
the group is only if you want to keep pg in the production mode mainly then of course run
bundle install
so make sure everything is alright by running the server once more all the gems are ok now we move to the next step
2- make sure you are on the right heroku and apparently you are but here is the a nice trick you can do
rake assets:precompile
to make sure all your assets are compiled and ready then do the normal git procedure
git add .
git commit -am"latest or whatever you feel like"
3- last but not least push to heroku the right way
git push heroku master
You pushed to heroku but your database didn't run on heroku right
heroku run rails db:migrate
So now it should be all good to go.
If it's still not ok please tell us.
Hope that's helpful

Deploying app to Heroku: 'NameError: uninitialized constant Devise'

I want to deploy my Rails app to Heroku. Of course I have some additional gems included like 'devise' or 'rails_admin'. I have followed strictly Rails Girls' tutorial (http://guides.railsgirls.com/heroku/). I have faced some really annoying problem when running git push heroku master.
Counting objects: 220, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (198/198), done.
Writing objects: 100% (220/220), 94.69 KiB | 0 bytes/s, done.
Total 220 (delta 21), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.7.12
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Fetching gem metadata from https://rubygems.org/...........
remote: Installing i18n 0.7.0
remote: Installing rake 10.4.2
remote: Installing minitest 5.5.1
remote: Installing thread_safe 0.3.4
remote: Installing builder 3.2.2
remote: Installing erubis 2.7.0
remote: Installing mini_portile 0.6.2
remote: Installing mime-types 2.4.3
remote: Installing rack 1.6.0
remote: Installing arel 6.0.0
remote: Installing coffee-script-source 1.8.0
remote: Installing execjs 2.2.2
remote: Installing thor 0.19.1
remote: Installing hike 1.2.3
remote: Installing multi_json 1.10.1
remote: Using bundler 1.7.12
remote: Installing tilt 1.4.1
remote: Installing rails_serve_static_assets 0.0.4
remote: Installing rails_stdout_logging 0.0.3
remote: Installing sass 3.4.10
remote: Installing tzinfo 1.2.2
remote: Installing json 1.8.2
remote: Installing mail 2.6.3
remote: Installing rack-test 0.6.3
remote: Installing coffee-script 2.3.0
remote: Installing sprockets 2.12.3
remote: Installing rails_12factor 0.0.3
remote: Installing activesupport 4.2.0.rc3
remote: Installing rdoc 4.2.0
remote: Installing uglifier 2.7.0
remote: Installing rails-deprecated_sanitizer 1.0.3
remote: Installing globalid 0.3.0
remote: Installing activemodel 4.2.0.rc3
remote: Installing jbuilder 2.2.6
remote: Installing sdoc 0.4.1
remote: Installing activejob 4.2.0.rc3
remote: Installing activerecord 4.2.0.rc3
remote: Installing nokogiri 1.6.6.2
remote: Installing pg 0.18.1
remote: Installing loofah 2.0.1
remote: Installing rails-dom-testing 1.0.5
remote: Installing rails-html-sanitizer 1.0.1
remote: Installing actionview 4.2.0.rc3
remote: Installing actionpack 4.2.0.rc3
remote: Installing actionmailer 4.2.0.rc3
remote: Installing sprockets-rails 2.2.4
remote: Installing railties 4.2.0.rc3
remote: Installing coffee-rails 4.1.0
remote: Installing jquery-rails 4.0.1
remote: Installing rails 4.2.0.rc3
remote: Installing sass-rails 5.0.1
remote: Installing turbolinks 2.5.3
remote: Your bundle is complete!
remote: Gems in the groups development and test were not installed.
remote: It was installed into ./vendor/bundle
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Bundle completed (35.01s)
remote: Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: NameError: uninitialized constant Devise
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/config/initializers/devise.rb:3:in '<top (required)>'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:652:in 'block in load_config_initializer'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0.rc3/lib/active_support/notifications.rb:166:in 'instrument'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:651:in 'load_config_initializer'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:616:in 'block (2 levels) in <class:Engine>'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:615:in 'each'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:615:in 'block in <class:Engine>'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:30:in 'instance_exec'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:30:in 'run'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:55:in 'block in run_initializers'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:44:in 'each'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:44:in 'tsort_each_child'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:54:in 'run_initializers'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:352:in 'initialize!'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/config/environment.rb:5:in '<top (required)>'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:328:in 'require'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:328:in 'require_environment!'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:443:in 'block in run_tasks_blocks'
remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:64:in 'block (2 levels) in define'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to powerful-taiga-2060.
remote:
To https://git.heroku.com/powerful-taiga-2060.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/powerful-taiga-2060.git`
Here is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.0.rc3'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :production, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'bootstrap-generators', '~> 3.3.1'
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
gem 'rails_admin'
gem 'mocha'
gem 'nifty-generators'
gem 'jquery-turbolinks'
gem 'devise'
end
The problem must be with rake assets:precompile.
Could anyone help me? The problem really slows down my Rails Adventure.
None of the gems in your
group :development, :production, :test do
were installed based on the Heroku logs. Try putting them outside the group.
Edit: Remove Devise from the ":development, :production, :test:" group as Heroku is not going to install anything in the development or test group:
gem 'devise'
After that, go to the root directory of your project and do
git add .
to put the changes in queue. Then run
git commit -m "adds devise to gemfile"
to add the changes to your commit logs. Then run
git push heroku master
And everything should work.

git push heroku master fails even if everything seems to be fine

This is the console, everything seems to work fine until the launching module of git push
What's the problem?
# Rails Environment Configuration.
---
git:
user.name: Theofilos_Mouratidis
user.email: mtheofilos#gmail.com
version: git version 1.7.9.msysgit.0
ruby:
bin: C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe
version: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
rails:
bin: C:/RailsInstaller/Ruby1.9.2/bin/rails.bat
version: Rails 3.2.13
ssh:
public_key_location: C:\Users\acer/.ssh/id_rsa.pub
public_key_contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvrft8l3K12KfGo9uXrFfK
YhiQW2mHxoBIWaHXmFec7/14bx3awQLb8rG4zYZdrAWijy86vOJlk7jm07amwrOPKjkTYkIkHoclEu1y
wYS3PEPBCLe5gpPMIoej22T7X3PqLfLza3MpW6HSE3TOOT+dG74Ms0T6v8YOFQ19SiGwKTIAyF7Mczx0
xet9rKxxnRQuvyqByWq+ZOBSFao5zlqsfh8QWwGGh3thsjNo7ICDfP8tQmu57jjOTcjZC3st0tEzUoNK
zdXdz5PDLRo2fSXTKG7PhadLmLn4Cg4fhY6sOraXeYrzt9pVp0b9SYnWqTYNhi74kSx0z1i5lfna6eXk
w== Theofilos Mouratidis <mtheofilos#gmail.com>
C:\Sites>cd tama
C:\Sites\tama>heroku login
Enter your Heroku credentials.
Email: mtheofilos#gmail.com
Password (typing will be hidden):
Authentication successful.
C:\Sites\tama>git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .idea/workspace.xml
#
no changes added to commit (use "git add" and/or "git commit -a")
C:\Sites\tama>git add .
C:\Sites\tama>git commit
Aborting commit due to empty commit message.
C:\Sites\tama>git commit -m "nothing"
[master cd12603] nothing
1 files changed, 3 insertions(+), 3 deletions(-)
C:\Sites\tama>git push heroku master
Counting objects: 172, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (152/152), done.
Writing objects: 100% (172/172), 210.47 KiB | 67 KiB/s, done.
Total 172 (delta 41), reused 0 (delta 0)
remote:
remote: -----> Ruby/Rails app detected
remote: -----> WARNING: Removing `Gemfile.lock` because it was generated on Wind
ows.
remote: Bundler will do a full resolve so native gems are handled properl
y.
remote: This may result in unexpected gem versions being used in your app
.
remote: -----> Installing dependencies using Bundler version 1.3.2
remote: Running: bundle install --without development:test --path vendor/
bundle --binstubs vendor/bundle/bin
remote: Fetching gem metadata from https://rubygems.org/........
remote: Fetching gem metadata from https://rubygems.org/..
remote: Resolving dependencies...
remote: Installing rake (10.0.4)
remote: Installing i18n (0.6.1)
remote: Installing multi_json (1.7.2)
remote: Installing activesupport (3.2.13)
remote: Installing builder (3.0.4)
remote: Installing activemodel (3.2.13)
remote: Installing erubis (2.7.0)
remote: Installing journey (1.0.4)
remote: Installing rack (1.4.5)
remote: Installing rack-cache (1.2)
remote: Installing rack-test (0.6.2)
remote: Installing hike (1.2.2)
remote: Installing tilt (1.3.7)
remote: Installing sprockets (2.2.2)
remote: Installing actionpack (3.2.13)
remote: Installing mime-types (1.23)
remote: Installing polyglot (0.3.3)
remote: Installing treetop (1.4.12)
remote: Installing mail (2.5.3)
remote: Installing actionmailer (3.2.13)
remote: Installing arel (3.0.2)
remote: Installing tzinfo (0.3.37)
remote: Installing activerecord (3.2.13)
remote: Installing activeresource (3.2.13)
remote: Installing authlogic (3.3.0)
remote: Using bundler (1.3.2)
remote: Installing coffee-script-source (1.6.2)
remote: Installing execjs (1.4.0)
remote: Installing coffee-script (2.2.0)
remote: Installing rack-ssl (1.3.3)
remote: Installing json (1.7.7)
remote: Installing rdoc (3.12.2)
remote: Installing thor (0.18.1)
remote: Installing railties (3.2.13)
remote: Installing coffee-rails (3.2.2)
remote: Installing jquery-rails (2.2.1)
remote: Installing pg (0.15.1)
remote: Installing rails (3.2.13)
remote: Installing sass (3.2.8)
remote: Installing sass-rails (3.2.6)
remote: Installing uglifier (2.0.1)
remote: Your bundle is complete! It was installed into ./vendor/bundle
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby r
doc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Preparing app for Rails asset pipeline
remote: Detected manifest.yml, assuming assets were compiled locally
remote: -----> Rails plugin injection
remote: Injecting rails_log_stdout
remote: Injecting rails3_serve_static_assets
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby/Rails -> console, rake, web, worker
remote:
remote: -----> Compiled slug size: 9.4MB
remote: -----> Launching... ! Heroku push rejected, Could not communicate wi
th vendor, please try again later
remote:
To git#heroku.com:tamagotchi-connect.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:tamagotchi-connect.git'
C:\Sites\tama>
This is the Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.13'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'jquery-rails'
end
gem 'authlogic'

ROR Installation (Heroku Error Push Fail)

-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* sqlite3 (= 1.3.5)
* sass-rails (= 3.2.5)
* coffee-rails (= 3.2.2)
* uglifier (= 1.2.3)
* jquery-rails (= 2.0.2)
* pg (= 0.12.2)
You have deleted from the Gemfile:
* coffee-rails (~> 3.2.1)
* jquery-rails
* sass-rails (~> 3.2.3)
* sqlite3
* uglifier (>= 1.0.3)
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
As, log is saying:
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
I think you have not commited Gemfile.lock file before pushing to heroku. Run bundle install and then commit both Gemfile and Gemfile.lock. After that push code to heroku.

Regarding my app update on Heroku

Results logged to /tmp/build_207lfem2op1z3/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:intense-garden-9145.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:intense-garden-9145.git'
So please help me in solving this Iam new to Heroku and Ruby on rails
I have followed the following steps to update my app
git init
git add.
git commit -m '.'
git push heroku master
And I have got the following run error
saasbook#saasbook:~/hw2_rottenpotatoes$ git push heroku master
Counting objects: 462, done.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (462/462), 76.71 KiB, done.
Total 462 (delta 185), reused 427 (delta 172)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Installing rake (0.9.2.2)
Installing multi_json (1.0.4)
Installing activesupport (3.1.0)
Installing bcrypt-ruby (3.0.1) with native extensions
Installing builder (3.0.0)
Installing i18n (0.6.0)
Installing activemodel (3.1.0)
Installing erubis (2.7.0)
Installing rack (1.3.6)
Installing rack-cache (1.0.3)
Installing rack-mount (0.8.3)
Installing rack-test (0.6.1)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.0.3)
Installing actionpack (3.1.0)
Installing mime-types (1.17.2)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.3.0)
Installing actionmailer (3.1.0)
Installing arel (2.2.1)
Installing tzinfo (0.3.31)
Installing activerecord (3.1.0)
Installing activeresource (3.1.0)
Installing archive-tar-minitar (0.5.2)
Installing coffee-script-source (1.2.0)
Installing execjs (1.2.13)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.6.5) with native extensions
Installing rdoc (3.12)
Installing thor (0.14.6)
Installing railties (3.1.0)
Installing coffee-rails (3.1.1)
Installing columnize (0.3.6)
Installing haml (3.1.4)
Installing jquery-rails (1.0.19)
Installing libv8 (3.3.10.4)
Installing ruby_core_source (0.1.5)
Installing linecache19 (0.5.12) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Read-only file system - /usr/local/include/ruby-1.9.1/ruby-1.9.2-p290 (Errno::EROFS)
from /usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `each'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core'
from /usr/local/lib/ruby/1.9.1/tempfile.rb:320:in `open'
from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
from extconf.rb:19:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
Gem files will remain installed in /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12 for inspection.
Results logged to /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:intense-garden-9145.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:intense-garden-9145.git'
Below Iam posting my Gem file
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'haml'
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Typically you will only have ruby-debug gem in use in development, not in production. Make sure ruby-debug is in the :development or :test group in your Gemfile.
group :development, :test do
gem 'ruby-debug19', :require => 'ruby-debug'
end
Then try the following
Run bundle again
Commit your Gemfile and Gemfile.lock
Push to Heroku again
linecache19 is installed as a dependency of ruby-debug19, which you don't want to have in production anyway.
In your Gemfile, replace the line that says
gem 'ruby-debug19', :require => 'ruby-debug'
with this
group :development, :test do
gem 'ruby-debug19', require: 'ruby-debug'
end
which will mean that the debugger is only loaded in the development and test environments.
You're also going to run into trouble with sqlite3 which is not supported on Heroku either... see this question

Resources