I get the following error in apache log on puppet master:
Any ideas what could be wrong here:
[ E 2018-03-11 07:50:58.9057 10913/T8 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is cd3585fe. Please see earlier logs for details about the error.
App 10950 stdout:
App 10950 stdout:
[ E 2018-03-11 07:51:03.0922 10913/Te age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/puppet/rack/puppetmasterd: An error occurred while starting up the preloader.
Error ID: 01cd04d1
Error details saved to: /tmp/passenger-error-sAcbhg.html
Message from application: cannot load such file -- puppet/util/command_line (LoadError)
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
config.ru:32:in `block in <main>'
/usr/local/rvm/gems/ruby-2.4.1/gems/rack-2.0.4/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.4.1/gems/rack-2.0.4/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.2.1/src/helper-scripts/rack-preloader.rb:110:in `eval'
/usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.2.1/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
/usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.2.1/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.2.1/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.2.1/src/helper-scripts/rack-preloader.rb:29:in `<main>'
My config:
Centos 6.5,
Puppet 3.8.7,
Apache/2.2.15,
Phusion Passenger 5.2.1
Related
It's a simple 2 page Sinatra app and Heroku returns the following error messages.
I tried placing config.ru and app.rb below app folder and root path
but both did not work...
Am I missing something?
2018-03-22T18:40:51.490531+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `load'
2018-03-22T18:40:51.490533+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `<top (required)>'
2018-03-22T18:40:53.657577+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 22470`
2018-03-22T18:40:55.804338+00:00 heroku[web.1]: Process exited with status 1
2018-03-22T18:40:55.821099+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-22T18:40:55.675952+00:00 app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.4.0/bin/rackup)
2018-03-22T18:40:55.675970+00:00 app[web.1]: LoadError: cannot load such file -- ./app
2018-03-22T18:40:55.675972+00:00 app[web.1]: /app/config.ru:1:in `require'
2018-03-22T18:40:55.675973+00:00 app[web.1]: /app/config.ru:1:in `block in <main>'
2018-03-22T18:40:55.675974+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:55:in `instance_eval'
2018-03-22T18:40:55.675976+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:55:in `initialize'
2018-03-22T18:40:55.675977+00:00 app[web.1]: /app/config.ru:in `new'
2018-03-22T18:40:55.675978+00:00 app[web.1]: /app/config.ru:in `<main>'
2018-03-22T18:40:55.675980+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:49:in `eval'
2018-03-22T18:40:55.675981+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:49:in `new_from_string'
2018-03-22T18:40:55.675983+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:40:in `parse_file'
2018-03-22T18:40:55.675985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2018-03-22T18:40:55.675986+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:219:in `app'
2018-03-22T18:40:55.675988+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:354:in `wrapped_app'
2018-03-22T18:40:55.675990+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:283:in `start'
2018-03-22T18:40:55.675991+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:148:in `start'
2018-03-22T18:40:55.675993+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/bin/rackup:4:in `<top (required)>'
2018-03-22T18:40:55.675995+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `load'
2018-03-22T18:40:55.675997+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `<top (required)>'
2018-03-22T18:44:05.000000+00:00 app[api]: Build succeeded
2018-03-22T18:44:40.562559+00:00 heroku[web.1]: State changed from crashed to starting
2018-03-22T18:44:42.586913+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 5319`
2018-03-22T18:44:45.148047+00:00 heroku[web.1]: Process exited with status 1
2018-03-22T18:44:45.168235+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-22T18:44:45.025605+00:00 app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.4.0/bin/rackup)
2018-03-22T18:44:45.025629+00:00 app[web.1]: LoadError: cannot load such file -- sinatra/link_header
2018-03-22T18:44:45.025631+00:00 app[web.1]: /app/app/app.rb:2:in `require'
2018-03-22T18:44:45.025632+00:00 app[web.1]: /app/app/app.rb:2:in `<top (required)>'
2018-03-22T18:44:45.025634+00:00 app[web.1]: /app/config.ru:1:in `require'
2018-03-22T18:44:45.025635+00:00 app[web.1]: /app/config.ru:1:in `block in <main>'
2018-03-22T18:44:45.025637+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:55:in `instance_eval'
2018-03-22T18:44:45.025638+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:55:in `initialize'
2018-03-22T18:44:45.025641+00:00 app[web.1]: /app/config.ru:in `<main>'
2018-03-22T18:44:45.025640+00:00 app[web.1]: /app/config.ru:in `new'
2018-03-22T18:44:45.025642+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:49:in `eval'
2018-03-22T18:44:45.025644+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:49:in `new_from_string'
2018-03-22T18:44:45.025646+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/builder.rb:40:in `parse_file'
2018-03-22T18:44:45.025647+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2018-03-22T18:44:45.025649+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:219:in `app'
2018-03-22T18:44:45.025651+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:354:in `wrapped_app'
2018-03-22T18:44:45.025652+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:283:in `start'
2018-03-22T18:44:45.025654+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:148:in `start'
2018-03-22T18:44:45.025655+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/bin/rackup:4:in `<top (required)>'
2018-03-22T18:44:45.025657+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `load'
2018-03-22T18:44:45.025659+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `<top (required)>'
2018-03-22T19:04:36.398574+00:00 heroku[web.1]: Restarting
2018-03-22T19:04:36.399250+00:00 heroku[web.1]: State changed from up to starting
2018-03-22T19:04:37.265389+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-03-22T19:04:37.446567+00:00 heroku[web.1]: Process exited with status 1
2018-03-22T19:04:37.288342+00:00 app[web.1]: [4] - Gracefully shutting down workers...
2018-03-22T19:04:37.301303+00:00 app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.4.0/bin/rackup)
2018-03-22T19:04:37.301330+00:00 app[web.1]: SignalException: SIGTERM
2018-03-22T19:04:37.301336+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.3/lib/puma/cluster.rb:381:in `block in setup_signals'
2018-03-22T19:04:37.301338+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.3/lib/puma/cluster.rb:475:in `select'
2018-03-22T19:04:37.301339+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.3/lib/puma/cluster.rb:475:in `run'
2018-03-22T19:04:37.301340+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.3/lib/puma/launcher.rb:183:in `run'
2018-03-22T19:04:37.301341+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.3/lib/rack/handler/puma.rb:69:in `run'
2018-03-22T19:04:37.301343+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:297:in `start'
2018-03-22T19:04:37.301344+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/lib/rack/server.rb:148:in `start'
2018-03-22T19:04:37.301345+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.4/bin/rackup:4:in `<top (required)>'
2018-03-22T19:04:37.301347+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `load'
2018-03-22T19:04:37.301392+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/rackup:23:in `<top (required)>'
2018-03-22T19:04:38.773020+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 16845`
2018-03-22T19:04:40.529326+00:00 heroku[web.1]: Process exited with status 1
2018-03-22T19:04:40.538335+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-22T19:04:40.541186+00:00 heroku[web.1]: State changed from crashed to starting
2018-03-22T19:04:40.428727+00:00 app[web.1]: configuration /app/config.ru not found
2018-03-22T19:04:42.516252+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 3071`
2018-03-22T19:04:44.810385+00:00 heroku[web.1]: Process exited with status 1
2018-03-22T19:04:44.823666+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-22T19:04:44.653840+00:00 app[web.1]: configuration /app/config.ru not found
I just made the test, wrote a very simple Sinatra app and pushed it to Heroku.
Gemfile
source 'https://rubygems.org'
ruby '2.4.0'
gem 'sinatra'
config.ru
require './app'
run Sinatra::Application
app.rb
require 'sinatra'
get '/' do
"Hello world"
end
Launching rackup locally worked perfectly at this point, but when I pushed to heroku, I got an error as well, just like you. Looks like I was missing a Procfile. I then added a simple Procfile to tell Heroku what should be launched when running the app:
Procfile
web: bundle exec rackup config.ru -p $PORT
So at this point, I got this file hierarchy:
App directory
\
|– Gemfile
|– config.ru
|– app.rb
|– Procfile
And voilà, it now works perfectly. It might be worth giving it a shot and add this kind of Procfile to your project. You can find more details about Procfile on Heroku Getting started on Heroku with Ruby : Procfile and their devcenter article about process types and Procfiles.
We have UI automation test framework based on cucumber. Recently we have moved from Ruby 1.9.x to 2.2.0 and after that we are facing problem in login to our application via test framework. It says SSL connect reset problem.
Error Trace:
07:01:26 An existing connection was forcibly closed by the remote host. - SSL_connect (Errno::ECONNRESET)
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `ssl_connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:24:in `create_socket'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:739:in `block in connect'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:98:in `call'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:98:in `timeout'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:735:in `connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:497:in `query'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:170:in `query'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1238:in `do_get_block'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1021:in `block in do_request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1129:in `protect_keep_alive_disconnected'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1016:in `do_request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:858:in `request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:761:in `post'
<-- our Code for login kick in to call httpclient --->
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/rb_support/rb_language.rb:96:in `load'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:142:in `load_file'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:83:in `each'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:83:in `load_files!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime.rb:254:in `load_step_definitions'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime.rb:62:in `run!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/cli/main.rb:32:in `execute!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/bin/cucumber:8:in `<top (required)>'
I had the same issue a while back after moving to ruby 2.0.0
Follow the following steps to solve it
1)Visit the url http://curl.haxx.se/ca/cacert.pem save the contents as a .pem file(Do not save it as a text file.Make sure the extension is .pem)
2)Copy the file to any path in your local eg: C:\ruby200\ca_cert.pem (in my case)
3)Now add an Environment variable with Variable SSL_CERT_FILE and value "C:\ruby200\ca_cert.pem"(without quotes)(path is in my case.Replace with appropriate path)
(Environment variables can be added by navigating to Computer -> Advanced Settings -> Environment Variables)
4)Close all your command prompts and restart them.Things should work fine now
I think your gem is updated.Add these lines in your code to solve the problem
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
before http.use_ssl = true
I hope this might solve the problem.
I just finished chapter five of the Mike Hartle rails tutorial and was a little confused when I loaded my files to heroku and the css for whatever reason was not working its magic like it was for me localy. Here is a copy of my heroku logs if that helps at all.
2013-09-17T00:40:31.225391+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-09-17T00:40:31.225544+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-09-17T00:40:31.225544+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-17T00:40:31.225544+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-17T00:40:31.359182+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=fathomless-earth-8911.herokuapp.com fwd="66.235.48.7" dyno=web.1 connect=1ms service=4ms status=304 bytes=0
2013-09-17T00:40:31.225689+00:00 app[web.1]:
2013-09-17T00:40:31.225689+00:00 app[web.1]:
2013-09-17T00:40:31.225689+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/images/rails.png"):
2013-09-17T00:40:31.225689+00:00 app[web.1]:
2013-09-17T00:40:31.225689+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-09-17T00:40:31.225689+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-09-17T00:40:31.225689+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-17T00:40:31.226188+00:00 app[web.1]:
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-17T00:40:31.226188+00:00 app[web.1]:
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-09-17T00:40:31.226038+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-17T00:40:31.226188+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
I ran into the same issue (using Windows 7). I found that the question was only partially answered by Heijmans above. Hartl isn't very specific about why or how this error occurs but does address the issue in section 2.3.5 and the end of the intro to Chapter 3.
Mine worked after the following process.
First, I ran
> heroku run bundle exec rake assets:precompile
> heroku open
But I still got errors. Then I followed Hartl's suggestion in the book in the following manner.
> git add .
> git commit -m "Add precompiled assets for Heroku"
> git push
> git push heroku master
> heroku run rake db:migrate
> heroku open
Interestingly, Hartl states that "This shouldn’t be necessary, and I have been unable to reproduce the issue, but the reports are common enough that I include it here for reference."
[tag: heroku]
[tag: railstutorial.org]
[tag: Windows 7]
[tag: Rails 4]
In Production the asset pipeline will kick in and your app will look for the precompiled version of the assets. I'm not familiar with that tutorial but I am assuming because this is the leading cause of css and javascript not available in production (heroku). There are 2 ways you can fix this...
The first way is to precompile your assets on heroku by running the precompile command from your app's directory:
heroku run bundle exec rake assets:precompile
The second way (not suggested) is to turn of the asset pipeline by commenting these lines out in your config/environments/production.rb file:
# Do not fallback to assets pipeline if a precompiled asset is missed.
# config.assets.compile = false
You may also want to turn off digests for your asset urls if you are disabling your precompiled assets
# Generate digests for assets URLs.
# config.assets.digest = true
https://github.com/twilio/hurl
I can't achieve the running server on Heroku by the steps from the readme file.
steps I did:
git clone git://github.com/twilio/hurl
cd hurl
gem install bundler
bundle install
heroku create
git push heroku master
heroku open
using heroku logs I see the error of getting connection to PG
"/app/app/models/db.rb:16:in `initialize': could not connect to server: Connection refused (PG::Error)"
please help what I'm doing wrong..
update:
file:`db.rb`
15 class PostgresDB < AbstractDB
16 CONN = PG::Connection::new(
17 ENV.fetch("POSTGRES_HOST", "localhost"),
18 ENV.fetch("POSTGRES_PORT", 5432),
19 :dbname => ENV.fetch("POSTGRES_DATABASE", "hurls"),
20 :user => ENV.fetch("POSTGRES_USER", "postgres"),
21 :password => ENV.fetch("POSTGRES_PASSWORD", "postgres")
22 )
Changed the details from the config heroku addon server of postgresql and got this error:
Starting process with command `bundle exec rackup config.ru -p 16112`
2013-02-14T07:55:41+00:00 app[web.1]: LINE 1: INSERT INTO hurls VALUES ($1::varchar, $2::bytea)
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1137:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: /app/app/models/db.rb:39:in `exec': ERROR: relation "hurls" does not exist (PG::Error)
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/app.rb:35:in `initialize'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:1:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: ^
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1137:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/bin/rackup:4:in `<top (required)>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:69:in `each'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:13:in `block in <main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `load'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `<main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:100:in `start'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:70:in `block in setup_default_hurls'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:69:in `setup_default_hurls'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:1:in `<main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/app.rb:245:in `save_hurl'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/models/db.rb:39:in `save'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
2013-02-14T07:55:42+00:00 heroku[web.1]: Process exited with status 1
2013-02-14T07:55:42+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-14T07:55:43+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=my-hurl-*****.herokuapp.com fwd=95.65.21.178 dyno= queue= wait= connect= service= status=503 bytes=
Anyone achieved the working heroku server?
solved
added all configuration variables using:
$ heroku config:add POSTGRES_DATABASE=your_database
$ heroku config:add POSTGRES_HOST=your_host
$ heroku config:add POSTGRES_USER=your_user
$ heroku config:add POSTGRES_PASSWORD=your_password
$ heroku config:add POSTGRES_PORT=5432
or in one line: $ heroku config:add POSTGRES_DATABASE=your_database POSTGRES_HOST=your_host POSTGRES_USER=your_user POSTGRES_PASSWORD=your_password POSTGRES_PORT=5432
else create the tables manually:
$ heroku pg:psql
create table users (id character(40), content bytea);
create table hurls (id character(40), content bytea);
Other than the files in the config directory, generated by rails console, the gemfile too needs to be properly edited to work with postgresql, normally rails generate db.rb to use sqlite3 and same db is mentioned in gemfile too, they both needs to work with postgresql as heroku uses postgres, hope it might help.
What does Heroku mean by app[web.1] and by <main>:48?
I have a crash that happens only on Heroku and not on my computer, I'm trying to identify the precise line causing the crash. These are the logs
2012-10-08T21:31:49+00:00 app[web.1]: <main>:48:in `method_missing': wrong number of arguments (1 for 2) (ArgumentError)
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:104:in `block in initialize'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `load'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:104:in `==='
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `<main>'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:102:in `initialize'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:9:in `new'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:9:in `run'
2012-10-08T21:31:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:102:in `each'
2012-10-08T21:31:50+00:00 heroku[web.1]: Process exited with status 1
2012-10-08T21:31:50+00:00 heroku[web.1]: State changed from starting to crashed
2012-10-08T21:31:52+00:00 heroku[router]: Error H10 (App crashed) -> GET placeboxy.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
Is the crash in my code or in the web server Thin or elsewhere?
Edit I changed the Procfile to run the server unicorn on Heroku and the crashed stopped. No error with puma either. Any ideas? Is Thin to fault?
The app[web.1] is a tag that heroku adds to your log to mark which process is emitting the log, as all the logs are collected in a central place, you can still filter a single process and parse the process log.
The <main>:48: part means the file/line where the execution has been stopped because of the exception. In this case (<main>) it's the main script that's being run. You won't find your error there, probably. You have to search in the backtrace for the part of your code that is failing, look for something that's not an external library, nor core ruby. The backtrace you show is of no help, normally the error is much lower in the stack trace.