18

Having the following issue, BRAND NEW TO RoR, first time ever trying to upload an app to go live, first had hosting issues, then decided if i could fix them with heroku i would just use a custom domain with heroku...... No this isnt a test app "learning rails" thing, actual app i want to deploy for use within the business I own, any help would be great, I have searched and havent seen a solution to this problem.

Make sure 'gem install sqlite3 -v 1.3.7' succeeds before bundling.

Failed to install gems via Bundler

Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:peaceful-chamber-6371.git
[remote rejected] master -> master <pre-receive hook declined>
error: failed to push some refs to 'git@heroku.com:peaceful-chamber-6371.git

Gem File

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
end
group :production do
  gem 'pg'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'twitter-bootstrap-rails'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
Jeff Gray
  • 225
  • 1
  • 4
  • 13

7 Answers7

46

try this,

remove Gemfile.lock file and do bundle install , then git add, git commit and git push .

Vamsi Krishna B
  • 11,377
  • 15
  • 68
  • 94
  • 1
    sweet so that worked... but now the page i was looking for doesnt exist for where its suppose to be "deployed" to... what went wrong with that? – Jeff Gray Apr 01 '13 at 04:02
  • SIDE NOTE: it shows my custom favicon on the "doesnt exist page" If it matters here is my route... its very basic as this is just a one page, "log leads from fairs/festivals/home shows etc events instead of using scratch paper" not sure if I actually need to compile this into something more detailed like a few other apps i am still working on that are WAY more in depth. BoothLeads::Application.routes.draw do resources :leads – Jeff Gray Apr 01 '13 at 04:19
  • any additional help on the above comment would be appreciated... this is all new to me.. let alone all the "dynos" and whatever settings at heroku.. lol – Jeff Gray Apr 01 '13 at 05:03
  • have you migrated the database ? `heroku rake db:migrate` – Vamsi Krishna B Apr 01 '13 at 05:08
  • is it working locally ? check logs from heroku.. if its not working locally, cannot really comment much on your app without seeing the code , please create a separate question for that . – Vamsi Krishna B Apr 01 '13 at 05:15
  • yes its working for that.... ill create another question here in a second.. your help is appreciated. – Jeff Gray Apr 01 '13 at 05:16
  • Link to second question: http://stackoverflow.com/questions/15738040/heroku-page-doesnt-exist – Jeff Gray Apr 01 '13 at 05:22
  • That worked for me too. Just curious did you also change the name of your heroku app? That and adding S3 along with a custom domain at the same time? Or any of the above? – samuelkobe May 18 '13 at 01:07
  • So i did this, but my gemfile.lock didn't change. – j will Nov 18 '15 at 22:02
4

Look though the all of the output that Heroku writes to the console -- your error is likely to be there somewhere. I ran into this and found that the precompile step had failed. That can be run locally as well:

rake assets:precompile
Ultrasaurus
  • 3,031
  • 2
  • 33
  • 52
2

Although the question has an accepted answer, the answer did not help me, I had the same problem. The following worked for me, hence contributing. Heroku does not support sqlite 3. In this case, I had sqlite3 gem in my gemfile, which you are supposed to put in development group, and put postgres gem (which heroku supports) in production group.

1) Delete the gemfile.lock file (from your project folder)

2) In the gemfile, remove gem sqlite3 or similar sqlite3 gem

3) Instead of that add following to the end of file:

group :development, :test do
  gem 'sqlite3'
end
gem 'pg', group: :production`

Now, run the following commands in terminal:

bundle install
git add .
git commit
git push
git push heroku master

Although it was a silly mistake, It took me time to realize the same. Hope it helps someone.

Soviut
  • 88,194
  • 49
  • 192
  • 260
1

Heroku's asset plugins no longer work since Rails 4 does not support plugins. You need to use Heroku's asset gems instead. Place this in your Gemfile:

group :production do
  gem 'rails_12factor'
end

Answer found here: Heroku does NOT compile files under assets pipelines in Rails 4 worked for me

Community
  • 1
  • 1
Connor Leech
  • 18,052
  • 30
  • 105
  • 150
0

My issue was that I had my bower directory ignored in .gitignore.

So I either need to do bower install from my packages.json or check in my bower dir.

http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

I chose to check in my bower dir for a quick solution right now.

Ben Johnson
  • 150
  • 1
  • 10
0

Heroku does not like sqlite3, change gem 'sqlite3' with gem 'pg'

0

For M1 users,

bundle lock --add-platform x86_64-linux

to resolve the architecture conflict