2

I am new to programming and using RAILS on Cloud9 IDE. I am having difficulty trying to push my app into Heroku. I get the error:...

Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the buildpack
remote: 

NOTE: The tutorial I am following tells me at Heroku setup section:

Heroku uses the PostgreSQL database (pronounced “post-gres-cue-ell”, and often called “Postgres” for short), which means that we need to add the pg gem in the production environment to allow Rails to talk to Postgres:17

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

Question: How do I ADD the pg gem in the production environment (I suspect that the push rejected error is due to this)

Pardeep Dhingra
  • 3,916
  • 7
  • 30
  • 56
Chris Dormani
  • 476
  • 8
  • 21

2 Answers2

5

There should be a file in your application called Gemfile

open it up and add:

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

save the file, commit and try again.

wpp
  • 7,093
  • 4
  • 33
  • 65
  • Thank you. Do you mean add this text direct into the file itself at the bottom or inputed through the Command Line – Chris Dormani Jun 04 '15 at 13:41
  • It says cannot find Gemfile. Yet the Gemfile is opened with the group :production do gem 'pg', '0.17.1' gem 'rails_12factor', '0.0.2’ end – Chris Dormani Jun 04 '15 at 14:04
1

In your Gemfile

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

and also remove gem 'sqlite3' OR

group :development, :test do
  gem 'sqlite3'
end

Because heroku can't install the sqlite3 gem. But you can tell bundler that it shouldn't be trying to except when developing.

Then run bundle install and try to deploy on Heroku.

Akshay Borade
  • 2,442
  • 12
  • 26