Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.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/3/heroku/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 On Rails_Heroku - Fatal编程技术网

Ruby on rails heroku部署中的Ruby on Rails应用程序错误

Ruby on rails heroku部署中的Ruby on Rails应用程序错误,ruby-on-rails,heroku,Ruby On Rails,Heroku,该应用程序在DevelopmentLocalServer中运行良好,但在生产环境中运行不理想。 我在heroku logsI中有以下内容,我对日志进行了编辑,以便于阅读,我只列出了我认为存在的错误: 2015-05-15T23:58:43.894626+00:00 app[web.1]: Rendered layouts/_header.html.erb (8.5ms) 2015-05-15T23:58:43.885011+00:00 app[web.1]: Rendered movie

该应用程序在DevelopmentLocalServer中运行良好,但在生产环境中运行不理想。 我在heroku logsI中有以下内容,我对日志进行了编辑,以便于阅读,我只列出了我认为存在的错误:

2015-05-15T23:58:43.894626+00:00 app[web.1]:   Rendered layouts/_header.html.erb (8.5ms)
2015-05-15T23:58:43.885011+00:00 app[web.1]:   Rendered movies/index.html.erb within layouts/application (17.5ms)
2015-05-15T23:58:43.896788+00:00 app[web.1]: ActionView::Template::Error (undefined method `scard' for nil:NilClass):
2015-05-15T23:58:43.896785+00:00 app[web.1]: 
2015-05-15T23:58:43.896790+00:00 app[web.1]:     19:         <%if signed_in?%>
2015-05-15T23:58:43.896791+00:00 app[web.1]:     20:           <li>
2015-05-15T23:58:43.896794+00:00 app[web.1]:     22:               <i class="fi-shopping-cart"></i> My Cart (<span class="cart-count"><%=current_user.cart_count%></span>)
2015-05-15T23:58:43.896793+00:00 app[web.1]:     21:             <%= link_to cart_path do%>
2015-05-15T23:58:43.896796+00:00 app[web.1]:     23:             <%end%>
2015-05-15T23:58:43.896797+00:00 app[web.1]:     24:           </li>
2015-05-15T23:58:43.896799+00:00 app[web.1]:     25:           <li><%=link_to current_user.email, edit_user_registration_path%></li>
2015-05-15T23:58:43.896801+00:00 app[web.1]:   app/models/user.rb:36:in `cart_count'

2015-05-15T23:58:33.939033+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2015-05-15T23:58:33.933343+00:00 app[web.1]: Started GET "/movies/2" for 160.9.1.112 at 2015-05-15 23:58:33 +0000
2015-05-15T23:58:33.935944+00:00 app[web.1]: Processing by MoviesController#show as HTML
2015-05-15T23:58:33.935966+00:00 app[web.1]:   Parameters: {"id"=>"2"}
2015-05-15T23:58:33.938157+00:00 app[web.1]:   Movie Load (1.3ms)  SELECT  "movies".* FROM "movies" WHERE "movies"."id" = $1 LIMIT 1  [["id", 2]]
2015-05-15T23:58:33.939854+00:00 app[web.1]: 
2015-05-15T23:58:33.939856+00:00 app[web.1]: NoMethodError (undefined method `sismember' for nil:NilClass):
2015-05-15T23:58:33.939858+00:00 app[web.1]:   app/models/movie.rb:20:in `cart_action'
2015-05-15T23:58:33.939859+00:00 app[web.1]:   app/controllers/movies_controller.rb:9:in `show'

2015-05-15T23:58:28.575297+00:00 app[web.1]: Started GET "/movies/1" for 160.9.1.112 at 2015-05-15 23:58:28 +0000
2015-05-15T23:58:28.581745+00:00 app[web.1]:   Parameters: {"id"=>"1"}
2015-05-15T23:58:28.635038+00:00 app[web.1]: Completed 500 Internal Server Error in 53ms
2015-05-15T23:58:28.581412+00:00 app[web.1]: Processing by MoviesController#show as HTML
2015-05-15T23:58:28.618562+00:00 app[web.1]:   Movie Load (1.6ms)  SELECT  "movies".* FROM "movies" WHERE "movies"."id" = $1 LIMIT 1  [["id", 1]]
2015-05-15T23:58:28.636023+00:00 app[web.1]: 
2015-05-15T23:58:28.636027+00:00 app[web.1]: NoMethodError (undefined method `sismember' for nil:NilClass):
2015-05-15T23:58:28.636029+00:00 app[web.1]:   app/models/movie.rb:20:in `cart_action'
2015-05-15T23:58:28.636031+00:00 app[web.1]:   app/controllers/movies_controller.rb:9:in `show'
movie.rb:

我遵循了赫罗库的官方指南 即使测试运行正常,但无法在生产中运行 我知道检查所有这些线路很累,所以我将感谢您的帮助
PS:在开发/本地服务器完美运行时,日志中出现错误。仔细看

NoMethod Error (undefined method sismember' for nil:NilClass): 2015-05 15T20:59:10.873219+00:00 app[web.1]:   app/models/movie.rb:20:incart_action'

请向我们提供您的movie.rb型号以及您的电影控制器您是否添加了一些内容以在heroku redis to go/redis cloud/?上提供redis??默认设置没有启用它。我有redis.rb,其中有以下行:uri=uri.parseENV[REDISTOGO\u URL]redis=redis.new:URL=>uri我也尝试过修改代码,但没有成功。我遵循了heroku上的官方redis设置。您只隔离了错误,但没有给出任何问题的解决方案。是的,可能redis没有部署在heroku上。我想把它修好,但什么也没修好
NoMethod Error (undefined method sismember' for nil:NilClass): 2015-05 15T20:59:10.873219+00:00 app[web.1]:   app/models/movie.rb:20:incart_action'