Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
434 views
in Technique[技术] by (71.8m points)

push rails app to heroku

I am trying to push a rails application to heroku.

When I get to the last step:

git push heroku master

It doesn't work and gives me these errors:

Counting objects: 85, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (85/85), 24.38 KiB, done.
Total 85 (delta 23), reused 0 (delta 0)

-----> Heroku receiving push
 !     Heroku push rejected, no Rails or Rack app detected.

error: hooks/pre-receive exited with error code 1
To [email protected]:smooth-dusk-26.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:smooth-dusk-26.git'

I don't know what I'm doing wrong :(

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's the answer I got from Heroku and it worked for me (after trying different pg gems, adapters, and everything else on the 10 other posts about this)

1) add the line: gem 'pg' to your Gemfile.

2) Run the command bundle install to install the gem into your bundle.

3) Stage the Gemfile and Gemfile.lock changes: git add Gemfile Gemfile.lock

4) Commit the changes: git commit -m "Install the pg gem"

5) Redeploy to heroku: git push heroku master


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...