Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 应用程序在本地工作,但在Heroku上不工作_Ruby On Rails_Ruby_Heroku - Fatal编程技术网

Ruby on rails 应用程序在本地工作,但在Heroku上不工作

Ruby on rails 应用程序在本地工作,但在Heroku上不工作,ruby-on-rails,ruby,heroku,Ruby On Rails,Ruby,Heroku,我的“show.html.erb”中有此代码 我在heroku上运行了以下代码: $ git push $ git push heroku $ heroku run rake db:migrate 一切都在本地运行,所以我希望它能在Heroku上运行。但后来我受到了欢迎 很抱歉,出了点问题 在这一点上,我真的不确定发生了什么。我检查了heroku日志,发现这个ActionView::Template::Error(nil:NilClass的未定义方法content):也许这就是问题所在(不过还

我的“show.html.erb”中有此代码

我在heroku上运行了以下代码:

$ git push
$ git push heroku
$ heroku run rake db:migrate
一切都在本地运行,所以我希望它能在Heroku上运行。但后来我受到了欢迎

很抱歉,出了点问题

在这一点上,我真的不确定发生了什么。我检查了heroku日志,发现这个
ActionView::Template::Error(nil:NilClass的未定义方法
content):
也许这就是问题所在(不过还不确定)。但是我定义了
@l
,它从数据库中随机选取了一个笑话,那么为什么日志中提到了
nil:NilClass`呢。请帮我修一下这个好吗

编辑:

我的heroku日志:

2013-12-12T13:38:13.734760+00:00 app[web.1]:   Rendered kalendar/show.html.erb within layouts/application (0.8ms)
2013-12-12T13:38:13.735007+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2013-12-12T13:38:13.737468+00:00 app[web.1]: ActionView::Template::Error (undefined method `content' for nil:NilClass):
2013-12-12T13:38:13.735007+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2013-12-12T13:38:13.737468+00:00 app[web.1]: 
2013-12-12T13:38:13.737468+00:00 app[web.1]:      7:        <center><h6>Dzisiaj jest: <span class="label label-info"><%= Time.now.strftime("%d.%m.%Y") %></span><iframe class="pull-right" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FPWr-Kalendarz%2F622999367760849&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe></h6></center>
2013-12-12T13:38:13.737468+00:00 app[web.1]:      8:   
2013-12-12T13:38:13.737468+00:00 app[web.1]:      9:        <div><blockquote class="pull-left">
2013-12-12T13:38:13.737468+00:00 app[web.1]:     11:          <small><%= @l.author %> </small>
2013-12-12T13:38:13.737468+00:00 app[web.1]:     10:          <p id="mycontainer"><%= @l.content %> </p>
2013-12-12T13:38:13.737468+00:00 app[web.1]:     12:          <button class="btn btn-mini", "pull=right" type="button">Następny -></button>
2013-12-12T13:38:13.737468+00:00 app[web.1]:     13:        </blockquote></div>
2013-12-12T13:38:13.737825+00:00 app[web.1]: 
2013-12-12T13:38:13.737468+00:00 app[web.1]:   app/views/kalendar/show.html.erb:10:in `_app_views_kalendar_show_html_erb___3142504778803122676_70084739238140'
2013-12-12T13:38:13.737825+00:00 app[web.1]: 
2013-12-12T13:38:13.739896+00:00 app[web.1]: 
2013-12-12T13:38:13.739896+00:00 app[web.1]: ActionView::Template::Error (undefined method `content' for nil:NilClass):
2013-12-12T13:38:13.739896+00:00 app[web.1]:      7:        <center><h6>Dzisiaj jest: <span class="label label-info"><%= Time.now.strftime("%d.%m.%Y") %></span><iframe class="pull-right" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FPWr-Kalendarz%2F622999367760849&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe></h6></center>
2013-12-12T13:38:13.739896+00:00 app[web.1]:      8:   
2013-12-12T13:38:13.739896+00:00 app[web.1]:     10:          <p id="mycontainer"><%= @l.content %> </p>
2013-12-12T13:38:13.739896+00:00 app[web.1]:      9:        <div><blockquote class="pull-left">
2013-12-12T13:38:13.739896+00:00 app[web.1]:     11:          <small><%= @l.author %> </small>
2013-12-12T13:38:13.739896+00:00 app[web.1]:     12:          <button class="btn btn-mini", "pull=right" type="button">Następny -></button>
2013-12-12T13:38:13.739896+00:00 app[web.1]:     13:        </blockquote></div>
2013-12-12T13:38:13.739896+00:00 app[web.1]:   app/views/kalendar/show.html.erb:10:in `_app_views_kalendar_show_html_erb___3142504778803122676_70084739238140'
2013-12-12T13:38:13.740233+00:00 app[web.1]: 
2013-12-12T13:38:13.740233+00:00 app[web.1]: 
2013-12-12T13:38:13.741057+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=0ms service=25ms status=500 bytes=1266
2013-12-12T13:42:13.686261+00:00 app[web.1]: Processing by KalendarController#show as HTML
2013-12-12T13:42:13.685334+00:00 app[web.1]: Started GET "/" for 90.156.104.195 at 2013-12-12 13:42:13 +0000
2013-12-12T13:42:13.685334+00:00 app[web.1]: Started GET "/" for 90.156.104.195 at 2013-12-12 13:42:13 +0000
2013-12-12T13:42:13.686261+00:00 app[web.1]: Processing by KalendarController#show as HTML
2013-12-12T13:42:13.700988+00:00 app[web.1]: Completed 500 Internal Server Error in 15ms
2013-12-12T13:42:13.700988+00:00 app[web.1]:   Rendered kalendar/show.html.erb within layouts/application (0.8ms)
2013-12-12T13:42:13.700988+00:00 app[web.1]:   Rendered kalendar/show.html.erb within layouts/application (0.8ms)
2013-12-12T13:42:13.702991+00:00 app[web.1]:      8:   
2013-12-12T13:42:13.702991+00:00 app[web.1]:     11:          <small><%= @l.author %> </small>
2013-12-12T13:42:13.702991+00:00 app[web.1]:      9:        <div><blockquote class="pull-left">
2013-12-12T13:42:13.703331+00:00 app[web.1]: 
2013-12-12T13:42:13.702991+00:00 app[web.1]:     10:          <p id="mycontainer"><%= @l.content %> </p>
2013-12-12T13:42:13.702991+00:00 app[web.1]:     12:          <button class="btn btn-mini", "pull=right" type="button">Następny -></button>
2013-12-12T13:42:13.702991+00:00 app[web.1]:     13:        </blockquote></div>
2013-12-12T13:42:13.703331+00:00 app[web.1]:      8:   
2013-12-12T13:42:13.703331+00:00 app[web.1]:     11:          <small><%= @l.author %> </small>
2013-12-12T13:42:13.703331+00:00 app[web.1]:     10:          <p id="mycontainer"><%= @l.content %> </p>
2013-12-12T13:42:13.703331+00:00 app[web.1]:      7:        <center><h6>Dzisiaj jest: <span class="label label-info"><%= Time.now.strftime("%d.%m.%Y") %></span><iframe class="pull-right" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FPWr-Kalendarz%2F622999367760849&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe></h6></center>
2013-12-12T13:42:13.702991+00:00 app[web.1]:   app/views/kalendar/show.html.erb:10:in `_app_views_kalendar_show_html_erb___3142504778803122676_70084739238140'
2013-12-12T13:42:13.703331+00:00 app[web.1]: 
2013-12-12T13:42:13.703331+00:00 app[web.1]: 
2013-12-12T13:42:13.703331+00:00 app[web.1]:      9:        <div><blockquote class="pull-left">
2013-12-12T13:42:13.703608+00:00 app[web.1]: 
2013-12-12T13:42:13.703331+00:00 app[web.1]:     12:          <button class="btn btn-mini", "pull=right" type="button">Następny -></button>
2013-12-12T13:42:13.703331+00:00 app[web.1]: ActionView::Template::Error (undefined method `content' for nil:NilClass):
2013-12-12T13:42:13.703608+00:00 app[web.1]:   app/views/kalendar/show.html.erb:10:in `_app_views_kalendar_show_html_erb___3142504778803122676_70084739238140'
2013-12-12T13:42:13.703608+00:00 app[web.1]:     13:        </blockquote></div>
2013-12-12T13:42:13.703608+00:00 app[web.1]: 
2013-12-12T13:42:13.700988+00:00 app[web.1]: Completed 500 Internal Server Error in 15ms
2013-12-12T13:42:13.702991+00:00 app[web.1]:      7:        <center><h6>Dzisiaj jest: <span class="label label-info"><%= Time.now.strftime("%d.%m.%Y") %></span><iframe class="pull-right" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FPWr-Kalendarz%2F622999367760849&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe></h6></center>
2013-12-12T13:42:13.702991+00:00 app[web.1]: 
2013-12-12T13:42:13.702991+00:00 app[web.1]: ActionView::Template::Error (undefined method `content' for nil:NilClass):
2013-12-12T13:42:13.709613+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=31ms status=500 bytes=1266
2013-12-12T13:44:05.673627+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T13:44:13.629310+00:00 heroku[run.7282]: State changed from up to complete
2013-12-12T13:44:36.274158+00:00 heroku[run.2266]: State changed from up to complete
2013-12-12T13:44:46.099637+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2013-12-12T13:44:46.943517+00:00 app[web.1]: [2013-12-12 13:44:46] FATAL SignalException: SIGTERM
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2013-12-12T13:44:46.943708+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2013-12-12T13:44:46.943708+00:00 app[web.1]: [2013-12-12 13:44:46] INFO  WEBrick::HTTPServer#start done.
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2013-12-12T13:44:46.943708+00:00 app[web.1]: [2013-12-12 13:44:46] INFO  going to shutdown ...
2013-12-12T13:44:46.943708+00:00 app[web.1]:    bin/rails:4:in `require'
2013-12-12T13:44:46.943708+00:00 app[web.1]: Exiting
2013-12-12T13:44:46.943708+00:00 app[web.1]:    bin/rails:4:in `<main>'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2013-12-12T13:44:48.421969+00:00 heroku[web.1]: Process exited with status 143
2013-12-12T13:44:53.194153+00:00 heroku[web.1]: State changed from starting to up
2013-12-12T13:44:54.886028+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=748ms status=500 bytes=1266
2013-12-12T13:44:58.494336+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=52ms status=500 bytes=1266
2013-12-12T13:44:59.893294+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=7ms service=44ms status=500 bytes=1266
2013-12-12T13:45:01.715005+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=113ms status=500 bytes=1266
2013-12-12T13:44:23.059938+00:00 heroku[api]: Starting process with command `bundle exec rake db:populate` by siawmensah@gmail.com
2013-12-12T13:45:22.966815+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=6ms service=33ms status=500 bytes=1266
2013-12-12T13:44:27.944462+00:00 heroku[run.2266]: State changed from starting to up
2013-12-12T13:44:42.439607+00:00 heroku[web.1]: State changed from up to starting
2013-12-12T13:49:22.429144+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T13:49:25.743801+00:00 heroku[run.4519]: Awaiting client
2013-12-12T13:49:25.786121+00:00 heroku[run.4519]: Starting process with command `bundle exec rake db:migrate`
2013-12-12T13:49:25.875234+00:00 heroku[run.4519]: State changed from starting to up
2013-12-12T13:49:29.211204+00:00 heroku[run.4519]: Process exited with status 0
2013-12-12T13:49:29.238443+00:00 heroku[run.4519]: State changed from up to complete
2013-12-12T13:49:34.966709+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=34ms status=500 bytes=1266
2013-12-12T13:51:03.227983+00:00 heroku[run.9695]: State changed from up to complete
2013-12-12T13:51:08.517393+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=27ms status=500 bytes=1266
2013-12-12T13:51:09.560231+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=3ms service=25ms status=500 bytes=1266

在尝试显示@l之前,添加一个简单的检查,以确保@l有效,如下所示:

<p id="mycontainer"><%= @l.nil? ? 'No jokes found, sorry' : @l.content %> </p>


您的随机方法有时返回数据库中不存在的id值,因此find_by方法返回nil而不是引发错误,这是好的

但是,我建议您从现有的当前ID数组中随机选择一个ID值,而不是使用Donovan的方法在不存在时显示消息

例如:

random_id = Joke.all.map(&:id).sample
@joke = Joke.find_by_id(random_id)
现在您需要做的就是确保填充了数据库,因为[]。sample仍然返回nil

编辑: 另外,我建议在处理变量名时使用逻辑,在返回单个笑话对象时使用@Joke,在返回笑话数组时使用@jokes,这将更容易理解。

rand()在heroku上不起作用

尝试:


你能从Heroku日志中获得更多信息吗。你在heroku上的数据库中没有太多东西可以使用,而且这个数据库是空的,这不起作用。
Joke.find_by(id:rand(1..Joke.count))
我发布了我的日志。heroku是否运行rake db:populate来填充数据库。但这也不起作用。@l为零,这就是为什么您会收到错误消息的原因。因此,出于某种原因,这是失败的:@l=crook.find_by(id:rand(1..crook.count))。为什么不试试开个玩笑呢?数一数,看看桌上有没有?Monk_代码表明您的数据库表由于某种原因没有被填充。我认为他是对的,我认为这是失败的,因为我还没有在heroku上建立数据库。但是我运行heroku运行rakedb:populate,这无论如何都不起作用。或者我应该在seed.rb中放入一些数据?在运行
db:populate
之前,请执行相同的状态。不是更改。等等,您仍然得到“nil:NilClass的未定义方法'content'”?你把你的更改推给Heroku了吗?是的,我刚才在更改后推给Heroku了,但仍然没有更改。同样的错误。仍然在为nil:NilClass'获取
未定义的方法
content',我只能猜测您在页面的其他地方也在使用
@l.content
,您将希望在使用
@l
的任何地方进行相同的更改。但是,请确保您也看到@denniswell为我提供的解决方案,这很奇怪。因为我只使用了一次
@l.content
。在一页上。我尝试了“丹尼斯”的解决方案。同样的事情。这个
nil:NilClass
东西在哪里?我在本地数据库中放了一些笑话,并将所有内容都推给了heroku:(我也喜欢这样,我建议将这两种答案结合起来,因为使用此解决方案最终可能会得到nil。这确实是一个很好的建议!Rand()在Postgres数据库上不起作用,因此这与heroku无关。
Last login: Thu Dec 12 19:18:11 on ttys003
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /Users/siaW/Desktop/kalendar/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

emmanuels-imac:kalendar siaW$ heroku logs
2013-12-12T13:42:13.703608+00:00 app[web.1]:     13:        </blockquote></div>
2013-12-12T13:42:13.703608+00:00 app[web.1]: 
2013-12-12T13:42:13.700988+00:00 app[web.1]: Completed 500 Internal Server Error in 15ms
2013-12-12T13:42:13.702991+00:00 app[web.1]:      7:        <center><h6>Dzisiaj jest: <span class="label label-info"><%= Time.now.strftime("%d.%m.%Y") %></span><iframe class="pull-right" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FPWr-Kalendarz%2F622999367760849&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe></h6></center>
2013-12-12T13:42:13.702991+00:00 app[web.1]: 
2013-12-12T13:42:13.702991+00:00 app[web.1]: ActionView::Template::Error (undefined method `content' for nil:NilClass):
2013-12-12T13:42:13.709613+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=31ms status=500 bytes=1266
2013-12-12T13:44:05.673627+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T13:44:13.629310+00:00 heroku[run.7282]: State changed from up to complete
2013-12-12T13:44:36.274158+00:00 heroku[run.2266]: State changed from up to complete
2013-12-12T13:44:46.099637+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2013-12-12T13:44:46.943517+00:00 app[web.1]: [2013-12-12 13:44:46] FATAL SignalException: SIGTERM
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2013-12-12T13:44:46.943708+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2013-12-12T13:44:46.943708+00:00 app[web.1]: [2013-12-12 13:44:46] INFO  WEBrick::HTTPServer#start done.
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2013-12-12T13:44:46.943708+00:00 app[web.1]: [2013-12-12 13:44:46] INFO  going to shutdown ...
2013-12-12T13:44:46.943708+00:00 app[web.1]:    bin/rails:4:in `require'
2013-12-12T13:44:46.943708+00:00 app[web.1]: Exiting
2013-12-12T13:44:46.943708+00:00 app[web.1]:    bin/rails:4:in `<main>'
2013-12-12T13:44:46.943517+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2013-12-12T13:44:48.421969+00:00 heroku[web.1]: Process exited with status 143
2013-12-12T13:44:53.194153+00:00 heroku[web.1]: State changed from starting to up
2013-12-12T13:44:54.886028+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=748ms status=500 bytes=1266
2013-12-12T13:44:58.494336+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=52ms status=500 bytes=1266
2013-12-12T13:44:59.893294+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=7ms service=44ms status=500 bytes=1266
2013-12-12T13:45:01.715005+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=113ms status=500 bytes=1266
2013-12-12T13:44:23.059938+00:00 heroku[api]: Starting process with command `bundle exec rake db:populate` by siawmensah@gmail.com
2013-12-12T13:45:22.966815+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=6ms service=33ms status=500 bytes=1266
2013-12-12T13:44:27.944462+00:00 heroku[run.2266]: State changed from starting to up
2013-12-12T13:44:42.439607+00:00 heroku[web.1]: State changed from up to starting
2013-12-12T13:49:22.429144+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T13:49:25.743801+00:00 heroku[run.4519]: Awaiting client
2013-12-12T13:49:25.786121+00:00 heroku[run.4519]: Starting process with command `bundle exec rake db:migrate`
2013-12-12T13:49:25.875234+00:00 heroku[run.4519]: State changed from starting to up
2013-12-12T13:49:29.211204+00:00 heroku[run.4519]: Process exited with status 0
2013-12-12T13:49:29.238443+00:00 heroku[run.4519]: State changed from up to complete
2013-12-12T13:49:34.966709+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=34ms status=500 bytes=1266
2013-12-12T13:51:03.227983+00:00 heroku[run.9695]: State changed from up to complete
2013-12-12T13:51:08.517393+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=27ms status=500 bytes=1266
2013-12-12T13:51:09.560231+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=3ms service=25ms status=500 bytes=1266
2013-12-12T13:52:05.530539+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=3ms service=33ms status=500 bytes=1266
2013-12-12T14:01:12.840421+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=8ms service=32ms status=500 bytes=1266
2013-12-12T14:01:13.798926+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=5ms service=30ms status=500 bytes=1266
2013-12-12T14:02:25.893053+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=9ms service=28ms status=500 bytes=1266
2013-12-12T14:10:40.052935+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=7ms service=100ms status=500 bytes=1266
2013-12-12T14:17:42.867494+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=28ms status=500 bytes=1266
2013-12-12T14:19:04.381488+00:00 heroku[api]: Starting process with command `bundle exec rake db:populate` by siawmensah@gmail.com
2013-12-12T14:19:09.039027+00:00 heroku[run.2181]: State changed from starting to up
2013-12-12T14:19:09.145701+00:00 heroku[run.2181]: Awaiting client
2013-12-12T14:19:09.288308+00:00 heroku[run.2181]: Starting process with command `bundle exec rake db:populate`
2013-12-12T14:19:12.831097+00:00 heroku[run.2181]: Process exited with status 1
2013-12-12T14:19:12.860881+00:00 heroku[run.2181]: State changed from up to complete
2013-12-12T14:23:08.011600+00:00 heroku[api]: Starting process with command `bundle exec rake db:populate` by siawmensah@gmail.com
2013-12-12T14:23:13.078679+00:00 heroku[run.4911]: State changed from starting to up
2013-12-12T14:23:13.533233+00:00 heroku[run.4911]: Awaiting client
2013-12-12T14:23:13.581313+00:00 heroku[run.4911]: Starting process with command `bundle exec rake db:populate`
2013-12-12T14:23:19.847369+00:00 heroku[run.4911]: Process exited with status 1
2013-12-12T14:23:19.860400+00:00 heroku[run.4911]: State changed from up to complete
2013-12-12T14:26:31.825431+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T14:26:36.581342+00:00 heroku[run.4120]: Awaiting client
2013-12-12T14:26:36.626793+00:00 heroku[run.4120]: Starting process with command `bundle exec rake db:migrate`
2013-12-12T14:26:41.855736+00:00 heroku[run.4120]: State changed from up to complete
2013-12-12T14:26:41.839844+00:00 heroku[run.4120]: Process exited with status 0
2013-12-12T14:26:50.477466+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=37ms status=500 bytes=1266
2013-12-12T14:29:14.123333+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T14:29:18.312942+00:00 heroku[run.3578]: Awaiting client
2013-12-12T14:29:18.371912+00:00 heroku[run.3578]: Starting process with command `bundle exec rake db:migrate`
2013-12-12T14:29:18.471482+00:00 heroku[run.3578]: State changed from starting to up
2013-12-12T14:29:23.362281+00:00 heroku[run.3578]: Process exited with status 0
2013-12-12T14:31:05.504490+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=16ms service=46ms status=500 bytes=1266
2013-12-12T14:29:23.379276+00:00 heroku[run.3578]: State changed from up to complete
2013-12-12T14:35:18.938824+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T14:35:22.937717+00:00 heroku[run.9410]: State changed from starting to up
2013-12-12T14:35:26.995322+00:00 heroku[run.9410]: State changed from up to complete
2013-12-12T14:35:30.893618+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=3ms service=34ms status=500 bytes=1266
2013-12-12T14:35:22.744507+00:00 heroku[run.9410]: Awaiting client
2013-12-12T14:35:22.803390+00:00 heroku[run.9410]: Starting process with command `bundle exec rake db:migrate`
2013-12-12T14:35:26.979877+00:00 heroku[run.9410]: Process exited with status 0
2013-12-12T14:38:53.954686+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=5ms service=258ms status=500 bytes=1266
2013-12-12T14:41:40.175479+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=89ms status=500 bytes=1266
2013-12-12T14:49:29.480931+00:00 heroku[run.2515]: State changed from starting to up
2013-12-12T14:50:54.030490+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by siawmensah@gmail.com
2013-12-12T14:50:58.893089+00:00 heroku[run.7658]: State changed from starting to up
2013-12-12T14:50:58.975265+00:00 heroku[run.7658]: Awaiting client
2013-12-12T14:50:59.005656+00:00 heroku[run.7658]: Error R13 (Attach error) -> Failed to attach to process
2013-12-12T14:51:00.699641+00:00 heroku[run.7658]: Process exited with status 128
2013-12-12T14:51:01.199142+00:00 heroku[run.7658]: State changed from up to complete
2013-12-12T14:50:00.792442+00:00 heroku[run.2515]: State changed from up to complete
2013-12-12T14:52:27.379216+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=2ms service=255ms status=500 bytes=1266
2013-12-12T14:53:12.077208+00:00 heroku[run.3491]: State changed from up to complete
2013-12-12T14:54:17.017016+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=1ms service=33ms status=500 bytes=1266
2013-12-12T14:54:44.964666+00:00 heroku[router]: at=info method=GET path=/ host=hidden-river-2301.herokuapp.com fwd="90.156.104.195" dyno=web.1 connect=6ms service=32ms status=500 bytes=1266
2013-12-12T15:57:38.455980+00:00 heroku[web.1]: Idling
2013-12-12T15:57:38.456870+00:00 heroku[web.1]: State changed from up to down
emmanuels-imac:kalendar siaW$ 
<p id="mycontainer"><%= @l.nil? ? 'No jokes found, sorry' : @l.content %> </p>
random_id = Joke.all.map(&:id).sample
@joke = Joke.find_by_id(random_id)
@l = Joke.all.sample