I have a ruby on rails app on Heroku, its been there for while with one dyno ( kinda experminetation project ).
Today I changed some text entries in one of the files under views. started the server locally and got it ti run, did a push to heroku and all of the sudden after that push Heroku stopped working. Running heroku logs I get this
013-06-15T22:09:30.344294+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/" dyno= connect= service= status=503 bytes=
So I login to heroku to see whats the matter, I notice I don't have any dynos available for this app. After some googling I got some results to add a dyno using this command
heroku ps:scale web=1
Scaling web dynos... failed
! No such type as web.
But the message coming back was that no such type as web!!
What did I do wrong? All the edit I did was some text ( its my blog ).
PS :
I don't have a procfile, and I checked on my git history and I never did have a Procfile, and this has worked before.
ok so I found the answer,
Basically I had to add a Procfile ( still don't know why because my app was working before without one ), and in that procfile I do
web: bundle exec unicorn -p $PORT -E $RACK_ENV
Heroku recommends this approach for production apps.
link to heroku article
https://devcenter.heroku.com/articles/rails3#deploy-your-application-to-heroku
Related
React frontend with rails backend. Deploying with NPM. Deployed successfully but failing to fetch with this error--
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/users"
There's no information in the logs about what crashed it ends with:
2020-06-19T01:21:42.298326+00:00 heroku[web.1]: Process exited with status 1
2020-06-19T01:21:42.342497+00:00 heroku[web.1]: State changed from starting to crashed
I get this warning when pushing to heroku
remote: Detecting rails configuration failed
remote: set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
I've been googling this all day and can not find a solution. What I can gather is that it just isn't connecting to the postgres db. How do I debug this?
You can actually ssh into the heroku using the heroku-cli instance to try to start rails server on your own.
or look into the log folder.
heroku ps:exec -a your-app-name
I have the logs and one error at the bottom I have tried rake db migrate. which didn't work either.
2017-01-28T17:08:44.257358+00:00 heroku[router]: at=info method=POST path="/sign_in" host=www.pointsonpaper.com request_id=17ca7be4-c859-47ba-b680-fc1d13a2aaaf fwd="104.57.187.118" dyno=web.1 connect=0ms service=690ms status=500 bytes=906
eo you have a rails app deployed on heroku? If so,
well on heroku you should run
heroku run rake db:migrate
However, to be more precise you should show your logs.
Run heroku logs in your terminal and post the actual error here.
I am writing my first ever ruby on rails app.
Locally its great, I can visit localhost:3000/ and get the default landing page, and I can visit /users to interact with a scaffold object called User.
I am using postgresql for my db and this again works locally.
I want to deploy this project to heroku. I make sure git is pushed to heroku, which it is, I also ran heroku addons:add heroku-postgresql:development and i also run heroku run rake db:migrate which completes with no output.
When I visit my applications URL I see nothing :https://whats-on-today.herokuapp.com/ Heroku logs shows a http 404:
2014-12-02T17:03:48.311284+00:00 heroku[router]: at=info method=GET path="/" host=whats-on-today.herokuapp.com request_id=fcb9cc27-e5eb-4760-bc30-8a72fe2f0bbc fwd="195.212.29.67" dyno=web.1 connect=1ms service=10ms status=404 bytes=1829
I am not sure why I can access the root url http://localhost:3000/ locally no problem, on deployment to heroku I see nothing? There is nothing much of use in the logs other than the 404. What is my deployed http path? Surely this should work if it works locally?
Can somebody please help?
You did not define a root route. Try something like this in routes.rb
root 'welcome#index'
(The page welcome/index needs to exist obviously).
Your application is deployed correctly as https://whats-on-today.herokuapp.com/users clearly shows.
I am trying to follow Michael Hartl's rails tutorial adding authentication step 7.29 (http://ruby.railstutorial.org/chapters/sign-up#top). My project works locally but I get "an error occurred in the application and your page could not be served" when I try deploying to heroku. These are my log errors:
heroku[api]: Starting process with command `bundle exec rake db:migrate` by connorleech#gmail.com
heroku[run.1285]: Awaiting client
heroku[run.1285]: Starting process with command `bundle exec rake db:migrate`
heroku[run.1285]: State changed from starting to up
heroku[run.1285]: Process exited with status 0
heroku[run.1285]: State changed from up to complete
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=jason-shark-rails-project.herokuapp.com fwd="41.74.174.50" dyno= connect= service= status=503 bytes=
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `bin/rails server -p 10431 -e $RAILS_ENV`
app[web.1]: bash: bin/rails: No such file or directory
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
heroku[web.1]: Stopping process with SIGKILL
It seems I may be missing something in my project in order to deploy it.. bash: bin/rails: No such file or directory
Why does my app work locally but not deploy to heroku?
Rails 4 project had a /bin directory, unlike some older Rails 3 projects I had cloned. /bin contains 3 files, bundle, rails, and rake, but these weren't making it to Heroku because I had bin in my global .gitignore file.
This is a pretty common ignore rule if you work with Git and other languages (Java, etc.), so to fix this:
Remove bin from ~/.gitignore
Run bundle install
Commit your
changes with git add . and git commit -m "Add bin back"
Push your changes to Heroku with git push heroku master
I had a similar problem, for some reason the /bin folder was not copying to my GitHub repo (check yours?). After trying many other solutions unsuccessfully, I ran git add bin and that let me push the bin folder to GitHub. I'm still unsure why I had to make this exception for the bin folder specifically. Running Ruby v2, Rails v4, on Linux.
This question already has answers here:
"bin/rails: No such file or directory" w/ Ruby 2 & Rails 4 on Heroku
(8 answers)
Closed 9 years ago.
I am having an issue with my deployment. My test env locally works great with no errors. When I push to Heroku I get this:
2013-07-17T15:54:04.619297+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-07-17T15:54:07.240398+00:00 heroku[web.1]: Process exited with status 127
2013-07-17T15:54:07.255379+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-17T15:54:13.467325+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-07-17T15:54:13.467325+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-07-17T15:54:58.714647+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=radiant-thicket-1062.herokuapp.com fwd="174.4.33.188" dyno= connect= service= status=503 bytes=
I am unsure where anything is calling bin/rails or how to solve this. I can't find any information on this anywhere else with the H10. It's like I'm the only person to ever experience this (unlikely..)!
I'd appreciate any insight or help. Thank you!
You're missing the bin folder that was added in Rails 4. Run rake rails:update:bin to create it, then make a commit and push to Heroku.
I found a solution to the problem - it's quite simple:
heroku config:set PATH=bin:vendor/bundle/ruby/2.0.0/bin:/usr/local/bin:/usr/bin:/bin
I found the solution here: https://devcenter.heroku.com/articles/ruby-versions
Adding the path won't necessarily help as it's looking for a 'bin' directory under your project directory, which is standard now under rails 4. Go see the answers under "bin/rails: No such file or directory" w/ Ruby 2 & Rails 4 on Heroku for more information.