Heroku cedar doesn't upgrade to ruby-1.9.3 - ruby-on-rails

Trying to port Heroku cedar from Ruby 1.9.2 to Ruby 1.9.3 fails :
2012-07-25T22:09:48+00:00 heroku[slugc]: Slug compilation started
2012-07-25T22:11:23+00:00 heroku[api]: Deploy abdaf18 by luca.soave#gmail.com
2012-07-25T22:11:23+00:00 heroku[api]: Release v244 created by luca.soave#gmail.com
2012-07-25T22:11:23+00:00 heroku[web.1]: State changed from up to starting
2012-07-25T22:11:24+00:00 heroku[deployhooks]: Notified New Relic about the deploy
2012-07-25T22:11:24+00:00 heroku[slugc]: Slug compilation finished
2012-07-25T22:11:26+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-07-25T22:11:27+00:00 app[web.1]: Exiting
2012-07-25T22:11:28+00:00 heroku[web.1]: Process exited with status 0
2012-07-25T22:11:28+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 12558`
2012-07-25T22:11:29+00:00 app[web.1]: Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3
2012-07-25T22:11:30+00:00 heroku[web.1]: Process exited with status 18
2012-07-25T22:11:30+00:00 heroku[web.1]: State changed from starting to crashed
2012-07-25T22:11:30+00:00 heroku[web.1]: State changed from crashed to starting
2012-07-25T22:11:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 36407`
2012-07-25T22:11:37+00:00 app[web.1]: Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3
2012-07-25T22:11:39+00:00 heroku[web.1]: Process exited with status 18
2012-07-25T22:11:39+00:00 heroku[web.1]: State changed from starting to crashed
2012-07-25T22:11:40+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-25T22:11:41+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=
2012-07-25T22:11:41+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=
UPDATE
I followed Heroku docs by having
ruby '1.9.3'
into my Gemfile and bundler --pre :
lsoave#ubuntu:~/rails/github/gitwatcher$ gem list bundler
*** LOCAL GEMS ***
bundler (1.2.0.pre.1, 1.1.4)
lsoave#ubuntu:~/rails/github/gitwatcher$
UPDATE
I follwed heroku suggestion: If absent or not the first entry, add bin: to the config with heroku config:add. but it doesn't work :
lsoave#ubuntu:~/rails/github/gitwatcher$ heroku config -s | grep PATH
GEM_PATH=vendor/bundle/ruby/1.9.1
PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
lsoave#ubuntu:~/rails/github/gitwatcher$
... this is strange because running ruby -v in the console give back the corret version :
lsoave#ubuntu:~/rails/github/gitwatcher$ heroku run:detached "ruby -v"
Running `ruby -v` detached... up, run.1
Use `heroku logs -p run.1` to view the output.
lsoave#ubuntu:~/rails/github/gitwatcher$ heroku logs -p run.1
2012-07-25T22:51:57+00:00 heroku[run.1]: Starting process with command `ruby -v`
2012-07-25T22:51:57+00:00 app[run.1]: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
2012-07-25T22:51:57+00:00 heroku[run.1]: State changed from starting to complete
2012-07-25T22:51:58+00:00 heroku[run.1]: Process exited with status 0
lsoave#ubuntu:~/rails/github/gitwatcher$
UPDATE
... moreover I did :
heroku config:add RUBY_VERSION=ruby-1.9.3-p194
heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
recompile ( change + git commit + git push heroku +master )
but nothing, it crash after recompilation this way :
2012-07-25T23:18:47+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-25T23:18:47+00:00 heroku[nginx]: 93.34.152.105 - - [25/Jul/2012:23:18:47 +0000] "GET / HTTP/1.1" 503 601 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1" gitwatcher.com
UPDATE
Opened Heroku Call Request #58410

It was not a ruby version problem, infact I notice the following error during heroku compilation, even if it didn't block the deploy and the push completed without other problems :
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
Invalid CSS after "...nd-image:url(""": expected ")", was "/assets/twitter..."
(in /tmp/build_19ypab978ku1z/app/assets/stylesheets/application.css)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Injecting rails31_enable_runtime_asset_compilation
Please see this article for troubleshooting help:
http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting
then looking better into heroku logs, I also see this one :
psych/syntax_error.rb:5:in 'initialize': wrong number of arguments (1 for 6) (ArgumentError)
and googling it turns out something similar, I tried and it works !

2012-07-25T22:11:29+00:00 app[web.1]: Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3
https://devcenter.heroku.com/articles/ruby-versions

Related

Debugging Heroku using logs

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

Heroku app crashes, but logs don't display error?

I looked at the other similar questions, and none of the solutions worked for me.
I'm using rails, ruby > 2.2. I precompiled my assests beforehand, and followed the steps on the heroku website for deployment.
Heroku restart or Heroku open yields the following logs
T13:23:51.140722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-reef-67177.herokuapp.com request_id=ddb61e34-f755-4c7b-b6e7-fbb7d2d2c545 fwd="99.99.45.37" dyno= connect= service= status=503 bytes= protocol=https
2017-08-16T13:26:09.989021+00:00 heroku[web.1]: State changed from crashed to starting 2017-08-16T13:26:12.914632+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 16431 -e production` 2017-08-16T13:26:18.084985+00:00 heroku[web.1]: Process exited with status 1
2017-08-16T13:26:17.981060+00:00 app[web.1]: 2017-08-16T13:26:17.981072+00:00 app[web.1]:
2017-08-16T13:26:17.981118+00:00 app[web.1]: >>>> A cacert.pem bundle could not be downloaded. 2017-08-16T13:26:17.981452+00:00 app[web.1]: => Booting Puma
2017-08-16T13:26:17.981454+00:00 app[web.1]: => Run `rails server -h` for more startup options 2017-08-16T13:26:17.981454+00:00 app[web.1]: => Rails 5.1.3 application starting in production on http://0.0.0.0:16431 2017-08-16T13:26:17.981457+00:00 app[web.1]: Exiting
2017-08-16T13:26:18.097040+00:00 heroku[web.1]: State changed from starting to crashed 2017-08-16T13:28:52.442323+00:00 app[api]: Starting process with command `bundle exec rake db:setup` by user smantri7#gatech.edu 2017-08-16T13:28:58.768622+00:00 heroku[run.9307]: Awaiting client
2017-08-16T13:28:58.793376+00:00 heroku[run.9307]: Starting process with command `bundle exec rake db:setup`
2017-08-16T13:28:58.977883+00:00 heroku[run.9307]: State changed from starting to up 2017-08-16T13:29:06.107123+00:00 heroku[run.9307]: State changed from up to complete
2017-08-16T13:29:06.088150+00:00 heroku[run.9307]: Process exited with status 1 2017-08-16T13:29:25.187872+00:00 heroku[run.6090]: Awaiting client
2017-08-16T13:29:25.261306+00:00 heroku[run.6090]: Starting process with command `bundle exec rake db:create`
2017-08-16T13:29:25.463655+00:00 heroku[run.6090]: State changed from starting to up 2017-08-16T13:29:21.565730+00:00 app[api]: Starting process with command `bundle exec rake db:create` by user smantri7#gatech.edu
2017-08-16T13:29:33.024076+00:00 heroku[run.6090]: State changed from up to complete
2017-08-16T13:29:33.008825+00:00 heroku[run.6090]: Process exited with status 1
2017-08-16T13:31:57.967030+00:00 app[api]: Starting process with command `bundle exec rake db:push` by user smantri7#gatech.edu
2017-08-16T13:32:01.731122+00:00 heroku[run.8862]: Awaiting client
2017-08-16T13:32:01.787259+00:00 heroku[run.8862]: Starting process with command `bundle exec rake db:push`
2017-08-16T13:32:01.976994+00:00 heroku[run.8862]: State changed from starting to up
2017-08-16T13:32:09.014212+00:00 heroku[run.8862]: State changed from up to complete
2017-08-16T13:32:08.996819+00:00 heroku[run.8862]: Process exited with status 1 2017-08-16T13:33:08.827762+00:00 heroku[web.1]: State changed from crashed to starting
2017-08-16T13:33:12.246286+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40298 -e production`
The problem is here: >>>> A cacert.pem bundle could not be downloaded. You need to check an issue with cacert.pem

rails heroku - error code H10 bash: bin/rails: No such file or directory

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.

Heroku App Crash H10 - bash: bin/rails: No such file or directory [duplicate]

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.

Heroku, ror, no dynos

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

Resources