I deployed a small sinatra app on heroku. I get an internal server error message when I try to access the page. Here is what I get from heroku logs
2012-09-29T17:24:18+00:00 app[web.1]: TypeError - can't convert nil into an exact number:
2012-09-29T17:24:18+00:00 app[web.1]: /app/birthday_countdown.rb:9:in `+'
2012-09-29T17:24:18+00:00 app[web.1]: web.rb:5:in `block in <main>'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `block in compile!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `[]'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in `route_eval'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (2 levels) in route!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `process_route'
2012-09-29T17:24:18+00:00 app[web.1]: /app/birthday_countdown.rb:9:in `initialize'
2012-09-29T17:24:18+00:00 app[web.1]: web.rb:5:in `new'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `each'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in `dispatch!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `block in call!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in `block in process_route'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (3 levels) in route!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `catch'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `block in invoke'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/rub
y/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `catch'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `route!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `call!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in `block in route!'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/logger.rb:15:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:129:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `invoke'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `block in call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:in `synchronize'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `pre_process'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/commonlogger.rb:20:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `block in spawn_threadpool'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:80:in `block in pre_process'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:136:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `call'
2012-09-29T17:24:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `catch'
2012-09-29T17:24:18+00:00 app[web.1]: 180.215.44.250 - - [29/Sep/2012 17:24:18] "GET / HTTP/1.1" 500 30 0.0012
2012-09-29T17:24:18+00:00 heroku[router]: GET debo-ka-birthday.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=8ms status=500 bytes=30
I have made the following changes in my app,
#month = Time.at(Time.now.utc + Time.zone_offset('IST')).month
#day = Time.at(Time.now.utc + Time.zone_offset('IST')).day
#year = Time.at(Time.now.utc + Time.zone_offset('IST')).year
from
#month = Time.now.month
#day = Time.now.day
#year = Time.now.year
I did this because I wanted the time to be according to Indian Standard Time and not the time on heroku server. This however has broken the app, can someone tell me how to fix it?
“IST” isn’t one of the timezones included in the time standard library, so Time.zone_offset('IST') returns nil.
You can use the actual offset for IST instead:
Time.at(Time.now.utc + Time.zone_offset('+05:30')).month
It might be easier to use the localtime method:
Time.now.localtime('+05:30')
which gives the same result.
Related
Using Heroku to host a Sinatra app. I have a route that's supposed to send an SMS. It returns a 500 internal server error instead.
Everything works perfectly fine in localhost. The logs show a Twilio::REST::RequestError.
main.rb
post '/sms/send' do
#client = Twilio::REST::Client.new account_sid, auth_token
#client.account.messages.create(
from: '+xxxxxxxxxxx',
to: '+xxxxxxxxxxx',
body: 'Robot invasion! Reply back with any sightings.'
)
end
Logs:
2017-05-17T19:04:24.640120+00:00 heroku[router]: at=info method=POST path="/sms/send" host=dysfunctionalapp.herokuapp.com request_id=a3736f1a-2264-4b91-b0a9-a3bde94342bd fwd="216.73.77.194" dyno=web.1 connect=0ms service=22ms status=500 bytes=255 protocol=https
2017-05-17T19:04:24.639060+00:00 app[web.1]: 2017-05-17 19:04:24 - Twilio::REST::RequestError - Twilio::REST::RequestError:
2017-05-17T19:04:24.639072+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/twilio-ruby-4.13.0/lib/twilio-ruby/rest/base_client.rb:125:in `connect_and_send'
2017-05-17T19:04:24.639074+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/twilio-ruby-4.13.0/lib/twilio-ruby/rest/base_client.rb:55:in `block (2 levels) in <class:BaseClient>'
2017-05-17T19:04:24.639075+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/twilio-ruby-4.13.0/lib/twilio-ruby/rest/list_resource.rb:94:in `create'
2017-05-17T19:04:24.639076+00:00 app[web.1]: /app/main.rb:84:in `block in <top (required)>'
2017-05-17T19:04:24.639078+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1632:in `call'
2017-05-17T19:04:24.639078+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1632:in `block in compile!'
2017-05-17T19:04:24.639079+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:991:in `block (3 levels) in route!'
2017-05-17T19:04:24.639095+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1010:in `route_eval'
2017-05-17T19:04:24.639096+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:991:in `block (2 levels) in route!'
2017-05-17T19:04:24.639097+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1037:in `block in process_route'
2017-05-17T19:04:24.639097+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1035:in `catch'
2017-05-17T19:04:24.639098+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1035:in `process_route'
2017-05-17T19:04:24.639099+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:989:in `block in route!'
2017-05-17T19:04:24.639099+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:988:in `each'
2017-05-17T19:04:24.639100+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:988:in `route!'
2017-05-17T19:04:24.639101+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1094:in `block in dispatch!'
2017-05-17T19:04:24.639101+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `block in invoke'
2017-05-17T19:04:24.639102+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `catch'
2017-05-17T19:04:24.639102+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `invoke'
2017-05-17T19:04:24.639103+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1091:in `dispatch!'
2017-05-17T19:04:24.639104+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:923:in `block in call!'
2017-05-17T19:04:24.639105+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `block in invoke'
2017-05-17T19:04:24.639105+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `catch'
2017-05-17T19:04:24.639106+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1073:in `invoke'
2017-05-17T19:04:24.639106+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:923:in `call!'
2017-05-17T19:04:24.639107+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:913:in `call'
2017-05-17T19:04:24.639108+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/xss_header.rb:18:in `call'
2017-05-17T19:04:24.639108+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/path_traversal.rb:16:in `call'
2017-05-17T19:04:24.639109+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/json_csrf.rb:26:in `call'
2017-05-17T19:04:24.639110+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/base.rb:50:in `call'
2017-05-17T19:04:24.639110+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/base.rb:50:in `call'
2017-05-17T19:04:24.639111+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/frame_options.rb:31:in `call'
2017-05-17T19:04:24.639112+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/logger.rb:15:in `call'
2017-05-17T19:04:24.639113+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/common_logger.rb:33:in `call'
2017-05-17T19:04:24.639113+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:231:in `call'
2017-05-17T19:04:24.639114+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:224:in `call'
2017-05-17T19:04:24.639114+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/head.rb:12:in `call'
2017-05-17T19:04:24.639115+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
2017-05-17T19:04:24.639116+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:194:in `call'
2017-05-17T19:04:24.639116+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1955:in `call'
2017-05-17T19:04:24.639117+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1499:in `block in call'
2017-05-17T19:04:24.639118+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1726:in `synchronize'
2017-05-17T19:04:24.639118+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.0/lib/sinatra/base.rb:1499:in `call'
2017-05-17T19:04:24.639125+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/connection.rb:86:in `block in pre_process'
2017-05-17T19:04:24.639125+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/connection.rb:84:in `catch'
2017-05-17T19:04:24.639126+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/connection.rb:84:in `pre_process'
2017-05-17T19:04:24.639127+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/connection.rb:53:in `process'
2017-05-17T19:04:24.639127+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/connection.rb:39:in `receive_data'
2017-05-17T19:04:24.639129+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/eventmachine-1.2.3/lib/eventmachine.rb:194:in `run_machine'
2017-05-17T19:04:24.639130+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/eventmachine-1.2.3/lib/eventmachine.rb:194:in `run'
2017-05-17T19:04:24.639130+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/backends/base.rb:73:in `start'
2017-05-17T19:04:24.639131+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/server.rb:162:in `start'
2017-05-17T19:04:24.639132+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/controllers/controller.rb:87:in `start'
2017-05-17T19:04:24.639133+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/runner.rb:200:in `run_command'
2017-05-17T19:04:24.639133+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/lib/thin/runner.rb:156:in `run!'
2017-05-17T19:04:24.639134+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thin-1.7.0/bin/thin:6:in `<top (required)>'
2017-05-17T19:04:24.639135+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/thin:22:in `load'
2017-05-17T19:04:24.639137+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
2017-05-17T19:04:24.639136+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/thin:22:in `<top (required)>'
2017-05-17T19:04:24.639138+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
2017-05-17T19:04:24.639139+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
2017-05-17T19:04:24.639140+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
2017-05-17T19:04:24.639138+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
2017-05-17T19:04:24.639140+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
2017-05-17T19:04:24.639141+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
2017-05-17T19:04:24.639142+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
2017-05-17T19:04:24.639143+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
2017-05-17T19:04:24.639144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
2017-05-17T19:04:24.639144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
2017-05-17T19:04:24.639145+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
2017-05-17T19:04:24.639146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
2017-05-17T19:04:24.639146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/bundle:22:in `load'
2017-05-17T19:04:24.639147+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/bundle:22:in `<main>'
2017-05-17T19:04:24.639551+00:00 app[web.1]: 216.73.77.194 - - [17/May/2017:19:04:24 +0000] "POST /sms/send HTTP/1.1" 500 30 0.0217
I'm kind of lost. I apologize for the vagueness. Where should I start?
As per discussion in comment, you have configuration problem. You can run program in locally(development environment) and not heroku(production environment).
As you mention in comment, you are using EVN to set credentials. You can do set this in 2 ways to set ENV in Heroku.
1) write configuration in config/production.rb
2) Recommended : Set ENV from Heroku Console. Here is Ref. link to do it Heroku config vars
You can also use Figaro gem for your application.
Hope that helps !
The changes I make on my app are readily seen on my localhost:3000, however, if I got to it through the link (http://amanjotkaur-bloccit.herokuapp.com/) the actions such as sign up or sign in are not working. Getting this message error: We're sorry, but something went wrong. If you are the application owner check the logs for more information.
I've ran heroku logs on vagrant and this is what I got:
2014-09-10T19:01:24.309885+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
2014-09-10T19:01:24.309886+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
2014-09-10T19:01:24.309888+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/schema_statements.rb:187:in `columns'
2014-09-10T19:01:24.309891+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/schema_cache.rb:44:in `yield'
2014-09-10T19:01:24.309905+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
2014-09-10T19:01:24.309909+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `call'
2014-09-10T19:01:24.309911+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `block in halting'
2014-09-10T19:01:24.309914+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
2014-09-10T19:01:24.309922+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
2014-09-10T19:01:24.309906+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
2014-09-10T19:01:24.309908+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2014-09-10T19:01:24.309913+00:00 app[web
.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `block in halting'
2014-09-10T19:01:24.309932+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
2014-09-10T19:01:24.309887+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:976:in `column_definitions'
2014-09-10T19:01:24.309893+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/schema_cache.rb:44:in `columns'
2014-09-10T19:01:24.309895+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/model_schema.rb:223:in `columns_hash'
2014-09-10T19:01:24.309907+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
2014-09-10T19:01:24.309912+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `call'
2014-09-10T19:01:24.309918+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
2014-09-10T19:01:24.309925+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
2014-09-10T19:01:24.309927+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
2014-09-10T19:01:24.309930+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
2014-09-10T19:01:24.309936+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2014-09-10T19:01:24.309955+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
2014-09-10T19:01:24.309894+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/model_schema.rb:214:in `columns'
2014-09-10T19:01:24.309924+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
2014-09-10T19:01:24.309931+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2014-09-10T19:01:24.309938+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
2014-09-10T19:01:24.309957+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `block in instrument'
2014-09-10T19:01:24.309962+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
2014-09-10T19:01:24.309898+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/inheritance.rb:23:in `new'
2014-09-10T19:01:24.309901+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
2014-09-10T19:01:24.309902+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:189:in `process_action'
2014-09-10T19:01:24.309903+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
2014-09-10T19:01:24.309923+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
2014-09-10T19:01:24.309954+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
2014-09-10T19:01:24.309919+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
2014-09-10T19:01:24.309933+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2014-09-10T19:01:24.309935+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
2014-09-10T19:01:24.309958+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-09-10T19:01:24.309965+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionview-4.1.5/lib/action_view/rendering.rb:30:in `process'
2014-09-10T19:01:24.309920+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
2014-09-10T19:01:24.309959+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `instrument'
2014-09-10T19:01:24.309967+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal.rb:196:in `dispatch'
2014-09-10T19:01:24.309928+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2014-09-10T19:01:24.309937+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
2014-09-10T19:01:24.309964+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:136:in `process'
2014-09-10T19:01:24.309952+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:19:in `process_action'
2014-09-10T19:01:24.309960+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
2014-09-10T19:01:24.309968+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
2014-09-10T19:01:24.309981+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `call'
2014-09-10T19:01:24.309998+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-09-10T19:01:24.309963+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2014-09-10T19:01:24.309974+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/mapper.rb:45:in `call'
2014-09-10T19:01:24.310001+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-09-10T19:01:24.309973+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:50:in `call'
2014-09-10T19:01:24.310000+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/flash.rb:254:in `call'
2014-09-10T19:01:24.309969+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_controller/metal.rb:232:in `block in action'
2014-09-10T19:01:24.309993+00:00 app[web.1]: ven
dor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-09-10T19:01:24.310005+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/query_cache.rb:36:in `call'
2014-09-10T19:01:24.309976+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `each'
2014-09-10T19:01:24.309997+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-09-10T19:01:24.310007+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
2014-09-10T19:01:24.309982+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:678:in `call'
2014-09-10T19:01:24.310003+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-09-10T19:01:24.309972+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
2014-09-10T19:01:24.309996+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-09-10T19:01:24.309992+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2014-09-10T19:01:24.310004+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/cookies.rb:560:in `call'
2014-09-10T19:01:24.309975+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
2014-09-10T19:01:24.309999+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-09-10T19:01:24.309970+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `call'
2014-09-10T19:01:24.309994+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-09-10T19:01:24.310008+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-09-10T19:01:24.310010+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:82:in `run_callbacks'
2014-09-10T19:01:24.310024+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-09-10T19:01:24.310026+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-09-10T19:01:24.310033+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-09-10T19:01:24.310011+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-09-10T19:01:24.310016+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/rack/logger.rb:38:in `call_app'
2014-09-10T19:01:24.310027+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
2014-09-10T19:01:24.310034+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-09-10T19:01:24.310021+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-09-10T19:01:24.310036+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-09-10T19:01:24.310017+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/rack/logger.rb:20:in `block in call'
2014-09-10T19:01:24.310029+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-09-10T19:01:24.310037+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-09-10T19:01:24.310013+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-09-10T19:01:24.310018+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-09-10T19:01:24.310030+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/engine.rb:514:in `call'
2014-09-10T19:01:24.310039+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-09-10T19:01:24.310012+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-09-10T19:01:24.310028+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-09-10T19:01:24.310019+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-09-10T19:01:24.310038+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-09-10T19:01:24.310014+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-09-10T19:01:24.310022+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/rack/logger.rb:20:in `call'
2014-09-10T19:01:24.310032+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/application.rb:144:in `call'
2014-09-10T19:01:24.310040+00:00 app[web.1]:
2014-09-10T19:01:24.310023+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-09-10T19:01:24.310041+00:00 app[web.1]:
I don't see any errors!
Does your gem file have the right dev and production database for Heroku? I got a similar error when I forgot to add postgres.
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :development do
gem 'sqlite3'
end
https://devcenter.heroku.com/articles/getting-started-with-rails4
This seems to be a Devise error (based on both what causes it -- Sign Up and Sign In, but not About -- and on the "Warden" in your error logs).
It's possible Devise has simply not been configured correctly.
Take a look at this article.
In your config/initializers/devise.rb file, you need to set something as a secret key. Generate one using rake secret (in the CL) if you haven't yet. And then save it as an environment variable and make sure that's on Heroku and your local environment.
If you already have a secure, environment-variabled key, it's probably another Devise config issue.
My app started crashing this afternoon after a deployment.
Here's the stack:
2013-07-26T17:56:41.137752+00:00 app[web.1]: ** [NewRelic][07/26/13 17:56:41 +0000 b35a7e48-4d93-4e0d-af43-376dec33f34b (2)] INFO : Starting Agent shutdown
2013-07-26T17:56:41.467644+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- JSON (LoadError)
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/lib/wwtk/device_api.rb:1:in `<top (required)>'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /
app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `each'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-07-26T17:56:41.467644+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:554:in `get'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:24:in `klass'
2013-07-26T17:56:41.467829+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `block in build'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `each'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `inject'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:1:in `<main>'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:140:in `start'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:1:in `new'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `build'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:470:in `app'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:4:in `block in <main>'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-07-26T17:56:41.467981+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `block in builder'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `call'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `build_app!'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/bin/unicorn:126:in `<top (required)>'
2013-07-26T17:56:41.468517+00:00 app[web.1]: from config.ru:4:in `require'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `eval'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
2013-07-26T17:56:41.468682+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
2013-07-26T17:56:43.135205+00:00 heroku[web.1]: State changed from starting to crashed
We haven't really changed our Gemfile.
The Gemfile.lock already contains json:
> grep json Gemfile.lock
multi_json (~> 1.0)
multi_json (~> 1.0)
json
json (1.8.0)
multi_json (>= 1.5)
multi_json (1.7.6)
multi_json (~> 1.0)
multi_json (~> 1.3)
json (~> 1.4)
multi_json (~> 1.0)
multi_json (~> 1.0)
multi_json (~> 1.0, >= 1.0.2)
I tried to restart the app or use heroku repo:purge_cache. Nothing helped.
Arg. It was a problem of case sensitivity in one of our requires
-require 'JSON'
+require 'json'
Fixed it. The development environment wasn't sensitive to this.
I'm very new to programming and just tried to put my first project online and am getting an internal server error. I don't quite even know where to start, I'm running Ruby on Sinatra and hosting it on Heroku
http://clearli.herokuapp.com/
here are my ruby logs for the lass request to the server, hoep I'm posting this question correctly. Any help would be much appreciated
2013-04-10T03:30:14.733305+00:00 app[web.1]: TypeError - nil can't be coerced into Float:
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/app.rb:35:in `-'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/app.rb:35:in `block in <top (required)>'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1415:in `call'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1415:in `block in compile!'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `[]'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `block (3 levels) in route!'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:960:in `route_eval'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:944:in `block (2 levels) in route!'
2013-04-10T03:30:14.733305+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:981:in `block in process_route'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:979:in `catch'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:979:in `process_route'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:943:in `block in route!'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:942:in `each'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:942:in `route!'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1053:in `block in dispatch!'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `block in invoke'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `catch'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `invoke'
2013-04-10T03:30:14.733614+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1050:in `dispatch!'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:878:in `block in call!'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `block in invoke'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `catch'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1035:in `invoke'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:878:in `call!'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:864:in `call'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb:18:in `call'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb:16:in `call'
2013-04-10T03:30:14.741803+00:00 heroku[router]: at=info method=GET path=/ host=clearli.herokuapp.com fwd="69.159.113.216" dyno=web.1 connect=1ms service=1474ms status=500 bytes=30
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb:18:in `call'
2013-04-10T03:30:14.733865+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb:31:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/logger.rb:15:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:209:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:202:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:172:in `call'
2013-04-10T03:30:14.734121+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1947:in `call'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1610:in `block in call'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1693:in `synchronize'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.4.2/lib/sinatra/base.rb:1610:in `call'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2013-04-10T03:30:14.734355+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2013-04-10T03:30:14.734355+00:00 app[web.1]: 69.159.113.216 - - [10/Apr/2013 03:30:14] "GET / HTTP/1.1" 500 30 1.4439
2013-04-10T03:30:16.891604+00:00 heroku[router]: at=info method=GET path=/ host=clearli.herokuapp.com fwd="69.159.113.216" dyno=web.1 connect=1ms service=1268ms status=500 bytes=30
app.rb
require 'rubygems'
require 'sinatra'
require 'haml'
require 'hashie'
require 'forecast_io'
require 'shotgun'
require 'geocoder'
Geocoder.configure(:timeout => 60)
Forecast::IO.configure do |configuration|
configuration.api_key = 'fe6fa0b5700a6134723fabdb8a08b296'
end
get '/' do
result = request.location
#lat = result.latitude
#long = result.longitude
city = request.location.city
#city = city
forecast = Forecast::IO.forecast(#lat, #long)
#current_temp = forecast.currently.temperature
#current_wind = (forecast.currently.windSpeed)
#current_icon = forecast.currently.icon
#current_clouds = forecast.currently.cloudCover
yesterday = Forecast::IO.forecast(#lat, #long, time: (Time.new.to_i - 86400))
#yesterday_temp = yesterday.currently.temperature
#yesterday_wind = (yesterday.currently.windSpeed)
#yesterday_clouds = yesterday.currently.cloudCover
#temp_difference = (#current_temp - #yesterday_temp)
#temp_difference_abs = #temp_difference.abs
#wind_difference = (((#current_wind - #yesterday_wind)/#yesterday_wind)*100)
#cloud_difference = (((#current_clouds - #yesterday_clouds)/#yesterday_clouds)*100)
#temp_description = "warmer"
if #temp_difference < 0
#temp_description = "colder"
end
#wind_description = "you dont need to worry about the wind"
if (#wind_difference >= 0 && #wind_difference <= 50)
#wind_description = "a bit windier"
elsif (#wind_difference > 50 && #wind_difference <= 100)
#wind_description = "noticeably windier"
elsif (#wind_difference > 100)
#wind_description = "much more windy"
elsif (#wind_difference <= 0 && #wind_difference >= -50)
#wind_description = "a bit less windy"
elsif (#wind_difference < -50 && #wind_difference >= -100)
#wind_description = "noticeably less windy"
elsif (#wind_difference < -100)
#wind_description = "way less windy"
end
#cloud_description = "no brighter or cloudier than"
if (#cloud_difference >= 0 && #cloud_difference <= 25)
#cloud_description = "a bit cloudier than"
elsif (#cloud_difference > 25 && #cloud_difference <= 75)
#cloud_description = "much more cloudy than"
elsif (#cloud_difference > 75)
#cloud_description = "disgustingly cloudy compared to"
elsif (#cloud_difference < 0 && #cloud_difference >= -25)
#cloud_description = "a bit clearer than"
elsif (#cloud_difference < -25 && #cloud_difference >= -75)
#cloud_description = "way clearer than"
elsif (#cloud_difference < -75)
#cloud_description = "incredibly clear compared to"
end
#unit = "degrees"
if #temp_difference == 1 || #temp_difference == -1
#unit = "degree"
end
haml :index
end
The line 35 of app.rb states:
#temp_difference = (#current_temp - #yesterday_temp)
The error means one of these temps is nil. AFAIU, on local machine your project was running w/o any problems, right? Hence the problem is with getting forecast. Would you retry getting the forecast until it’s finally yielded? Actually I have no clue what the Forecast::IO#forecast is supposed to return, but it seems to be partially OK (since there is no error getting members like yesterday.currently.temperature,) though not full of proper data (since the temperature returned is nil.)
Hope it helps.
I have a small Sinatra application that is calling a library I developed named Jido. This library is provided by a RubyGem that I list as a dependency in the Sinatra app's Gemfile. I can run this application without experiencing any errors on my local machine, which is running Ruby 1.9.2. When I push to Heroku and visit the page that makes use of this "Jido" library, however, the server returns an error. From the logs I see that the Heroku server is running Ruby 1.8.7. Here is the stack trace in the Heroku error log:
2011-02-16T18:42:29-08:00 app[web.1]: NameError - uninitialized constant Jido:
2011-02-16T18:42:29-08:00 app[web.1]: ./jido.rb:23:in `GET /conjugate/:lang/:verb'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1057:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1057:in `compile!'
2011-02-16T18:42:29-08:00 heroku[router]: GET jido.heroku.com/conjugate/en/be dyno=web.1 queue=0 wait=1029ms service=5ms bytes=228
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:643:in `instance_eval'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:643:in `route_eval'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:627:in `route!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:675:in `process_route'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:672:in `catch'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:672:in `process_route'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:626:in `route!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:625:in `each'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:625:in `route!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:760:in `dispatch!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:553:in `call!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:725:in `instance_eval'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:725:in `invoke'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:725:in `catch'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:725:in `invoke'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:553:in `call!'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:538:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/methodoverride.rb:24:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/commonlogger.rb:18:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1167:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1193:in `synchronize'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1167:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /home/heroku_rack/lib/static_assets.rb:9:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /home/heroku_rack/lib/last_access.rb:15:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `each'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /home/heroku_rack/lib/date_header.rb:14:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /app/9d9320fd-f5b9-4dca-a96e-0bdee91997b0/home/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:77:in `call'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/connection.rb:76:in `pre_process'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/connection.rb:74:in `catch'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/connection.rb:74:in `pre_process'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/connection.rb:57:in `process'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/connection.rb:42:in `receive_data'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/backends/base.rb:57:in `start'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/server.rb:156:in `start'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/controllers/controller.rb:80:in `start'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/thin/runner.rb:143:in `run!'
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/bin/thin:6
2011-02-16T18:42:29-08:00 app[web.1]: /usr/ruby1.8.7/bin/thin:19:in `load'
The lines relevant to this error, in my main Sinatra script:
require 'rubygems'
require 'sinatra'
require 'json'
require 'jido'
conjugators = {}
get '/conjugate/:lang/:verb' do
content_type :json
conjugator = nil
if conjugators[params[:lang]].nil?
conjugator = Jido.load params[:lang] # exception "Uninitialized constant Jido" is thrown here
conjugators[params[:lang]] = conjugator
else conjugator = conjugators[params[:lang]] end
conjugator.conjugate(params[:verb]).to_json
end
As I said, this code runs fine on my machine with Ruby 1.9.2. I have tested calling this Jido module from both the Sinatra app as well as from IRB — both run without problems. I see when I push to Heroku that the jido gem is installed as required by my Gemfile, but for some reason I can not reference it in my Sinatra script.. any ideas?
The full source for the Sinatra app (including the Gemfile and Gemfile.lock) is available at https://github.com/hans/jido-site .
I switched to the bamboo-mri-1.9.2 stack (I was previously on the bamboo-mri-1.8.7 stack) and that fixed it. Thanks so much for the help TK-421!