Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.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 Ruby精简服务器在生产中随机崩溃_Ruby On Rails_Ruby_Ruby On Rails 3_Ubuntu_Azure - Fatal编程技术网

Ruby on rails Ruby精简服务器在生产中随机崩溃

Ruby on rails Ruby精简服务器在生产中随机崩溃,ruby-on-rails,ruby,ruby-on-rails-3,ubuntu,azure,Ruby On Rails,Ruby,Ruby On Rails 3,Ubuntu,Azure,我在Azure服务器(Ubuntu 64位)上安装了RubyonRails应用程序。我已经分别安装了Nginx和Thin作为我们的web服务器和应用服务器。今天我的瘦服务器崩溃了,我的网站也崩溃了。我查看了日志,但没有发现任何可疑的东西 这是我的精简日志中的一个片段: Using rack adapter SECURITY WARNING: No secret option provided to Rack::Session::Cookie. T

我在Azure服务器(Ubuntu 64位)上安装了RubyonRails应用程序。我已经分别安装了Nginx和Thin作为我们的web服务器和应用服务器。今天我的瘦服务器崩溃了,我的网站也崩溃了。我查看了日志,但没有发现任何可疑的东西

这是我的精简日志中的一个片段:

 Using rack adapter
            SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
            This poses a security threat. It is strongly recommended that you
            provide a secret to prevent exploits that may be possible from crafted
            cookies. This will not be supported in future versions of Rack, and
            future versions will even invalidate your existing user cookies.

      Called from: /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.0/lib/thin/backends/base.rb:63:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/server.rb:159:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/thin:23:in `load'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/thin:23:in `<main>'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby_executable_hooks:15:in `eval'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby_executable_hooks:15:in `<main>'
Error during failsafe response: Missing template index/getkey, application/getkey with {:locale=>[:en], :formats=>[:gif, "image/*"], :handlers=>[:erb, :builder]}. Searched in:
  * "/home/webuser/apps/production/app/views"

  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/path_set.rb:58:in `find'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/lookup_context.rb:109:in `find'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:34:in `determine_template'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:10:in `render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:36:in `render_template'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:17:in `render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:110:in `_render_template'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/streaming.rb:225:in `_render_template'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:103:in `render_to_body'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:in `render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:16:in `render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /home/webuser/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `ms'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in `render'
  /home/webuser/apps/production/app/controllers/index_controller.rb:97:in `getkey'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__2157135730694343981__process_action__1990300394974926863__callbacks'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:76:in `render_exception'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:61:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/connection.rb:81:in `block in pre_process'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/connection.rb:79:in `catch'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/connection.rb:79:in `pre_process'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/connection.rb:54:in `process'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/connection.rb:39:in `receive_data'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/server.rb:159:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in `start'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/thin:23:in `load'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/thin:23:in `<main>'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby_executable_hooks:15:in `eval'
  /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby_executable_hooks:15:in `<main>'
>> Writing PID to tmp/pids/thin.3000.pid
>> Using rack adapter
        SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
        This poses a security threat. It is strongly recommended that you
        provide a secret to prevent exploits that may be possible from crafted
        cookies. This will not be supported in future versions of Rack, and
        future versions will even invalidate your existing user cookies.

        Called from: /home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
使用机架适配器
安全警告:没有为Rack::Session::Cookie提供机密选项。
这构成了安全威胁。强烈建议您
提供一个秘密,以防止可能的漏洞利用
饼干。未来版本的机架不支持此功能,并且
将来的版本甚至会使您现有的用户cookie失效。
从:/home/webuser/.rvm/gems/ruby-1.9.3调用-p545@woi/gems/actionpack-3.2.8/lib/action\u dispatch/middleware/session/abstract\u store.rb:28:在'initialize'中。0/lib/thin/backends/base.rb:63:在'start'中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/server.rb:159:in'start'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in'start'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:187:in'run_命令'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/lib/thin/runner.rb:152:in'run!'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/thin-1.5.0/bin/thin:6:in`'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/料仓/薄料仓:23:在“装载”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/箱/薄:23:in`'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby可执行文件挂钩:15:in'eval'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/bin/ruby\u可执行文件\u挂钩:15:in`'
故障保护响应期间出错:缺少模板索引/getkey,应用程序/getkey,带有{:locale=>[:en],:formats=>[:gif,“image/*”],:handlers=>[:erb,:builder]}。搜索:
*“/home/webuser/apps/production/app/views”
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/path\u set.rb:58:in'find'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/lookup\u context.rb:109:in'find'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/renderer/abstract\u renderer.rb:3:in'find\u template'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/renderer/template\u renderer.rb:34:“确定模板”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/renderer/template\u renderer.rb:10:in'render'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u view/renderer/renderer.rb:36:in'render\u template'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:17:in'render'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract\u controller/rendering.rb:110:在“渲染模板”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/streaming.rb:225:在“渲染模板”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract\u controller/rendering.rb:103:in'render\u to\u body'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:in“render_to_body”
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/compatibility.rb:50:in'render\u to\u body'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:in'render'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/rendering.rb:16:in'render'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in“渲染中的块(2级)”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u support/core\u ext/benchmark.rb:5:in`block in ms'
/home/webuser/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/benchmark.rb:295:in'realtime'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u support/core\u ext/benchmark.rb:5:in'ms'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in“渲染中的块”
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/instrumentation.rb:83:in'cleanup\u view\u runtime'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in'render'
/home/webuser/apps/production/app/controllers/index_controller.rb:97:in'getkey'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/implicit\u render.rb:4:in'send\u action'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract\u controller/base.rb:167:in'process\u action'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/action\u controller/metal/rendering.rb:10:in'process\u action'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract\u controller/callbacks.rb:18:in'block in process\u action'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u-support/callbacks.rb:414:在“运行”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u support/callbacks.rb:405:in`\u run\u callback'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u-support/callbacks.rb:385:在“运行\u流程\u操作\u回调”中
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/activesupport-3.2.8/lib/active\u support/callbacks.rb:81:in'run\u callbacks'
/home/webuser/.rvm/gems/ruby-1.9.3-p545@woi/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in`process
require "openssl"
require 'digest/sha2'
require 'base64'
require 'net/http'
require 'uri'
require 'cgi'
class IndexController < ApplicationController

  def index

    if params['_escaped_fragment_'] == '/Home' or params['_escaped_fragment_'] == '/home'
      redirect_to "#{root_url}", :status => :moved_permanently
    elsif params['_escaped_fragment_'] == '/Tv-Listings'
      @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/TVGuideDetailed?call=TVGuideDetailed&apikey=8a1e808b55fde9455cb3d8857ed88389&context=applicationname=sourcebits;headendid=2645&programmeimagesize=Large&channelimagesize=Large&Imagesize=Large&channelgenre=all&dateselected=0&mode=getTVGuideInfo&pageno=1&responseformat=json&responselanguage=English&starthour=0&totalhrdata=24"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] == '/Movies' or params['_escaped_fragment_'] == '/movies'
      fromdatetime = Time.now.year.to_s + "-" + Time.now.month.to_s + "-" + Time.now.day.to_s  + "+12:16"
      todatetime =  Time.now.year.to_s + "-" + Time.now.month.to_s + "-" + (Time.now + 4.day).day.to_s + "+23:59"
      @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/AllMovies?call=AllMovies&apikey=dd45045f8c68db9f54e70c67048d32e8&pageno=1&context=applicationname=website;headendid=2645&fromdatetime=#{fromdatetime}&todatetime=#{todatetime}&productionstartyear=2004&productionendyear=2015&programmeimagesize=xxlarge&castname=&isfavMovies=false&mode=getAllMovies&noCache=1389683687038&responseformat=json&responselanguage=English"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] == '/Videos' or params['_escaped_fragment_'] == '/videos'
      @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/VideosByFilter?call=VideosByFilter&apikey=53adaf494dc89ef7196d73636eb2451b&pageno=1&context=headendid=2645;applicationname=website&filtertype=popular&channelname=&videogenre=&programmeImageSize=xxlarge&mode=getAllVideos&noCache=1389685706035&responseformat=json&responselanguage=English"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] == '/Channels' or params['_escaped_fragment_'] == '/channels'
      @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/FeaturedProgramme?call=FeaturedProgramme&apikey=06138bc5af6023646ede0e1f7c1eac75&programmeimagesize=xxlarge&channelimagesize=xxlarge&imagesize=xxlarge&applicationname=website&operatorid=0&context=headendid=2645;applicationname=website&mode=featuredProgramme&pageno=1&responseformat=json&responselanguage=English"))
      @popular = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/HybridChannels?call=HybridChannels&apikey=fa83a11a198d5a7f0bf77a1987bcd006&responseformat=json&responselanguage=English&pageno=1&languageid=0&channelimagesize=small&context=headendid%3D0%3Bapplicationname%3Dwebsite&hybridgenre=Popular&mode=filterByHybridGenre"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] == '/Mobile-Apps' or params['_escaped_fragment_'] == '/apps'
      @testimonials = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/AppTestimonials?call=AppTestimonials&apikey=1fc214004c9481e4c8073e85323bfd4b&pageno=1&context=custid=1;msisdn=222;headendid=2645;applicationname=website&appid=1&mode=getAppTestimonials&responseformat=json&responselanguage=English"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] =~ /\/actor(.*)/
      actorname = CGI::escape(params['_escaped_fragment_'].split("/").last.gsub(/CeNc/,"$#*!").gsub(/DqO/, '"').gsub(/PLus/, '+').gsub(/ObR/, '[').gsub(/CbR/, ']').gsub(/AtR/, '@').gsub(/EmPe/, '&').gsub(/HaSh/, '#').gsub(/StAr/, '*').gsub("-", " ").gsub("~", "-").gsub("$", "/").gsub(/DoLr/, "$").gsub("*", "?").gsub("PeRc", "%"))
      result = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/CastIDByName?call=CastIDByName&apikey=bdf3f54642b2d80f8e87b6474eaaad11ece8058a&responseformat=json&responselanguage=English&context=custid=1;msisdn=222;headendid=2645;applicationname=website&castname=#{actorname}&mode=getActorId&pageno=1"))
      result = result["getcastid"]["castidbyname"]["castid"]
      @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/CastDetails?apikey=375f9609c9962cce0ad6ccaaabd80362ecd2b07f&responseformat=json&responselanguage=english&context=custid=1;msisdn=222;headendid=2645;applicationname=website&castid=#{result}"))
      @similaractors = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/SimilarCasts?call=SimilarCasts&apikey=731df0fc93417f72fcb56f09cd754f9382ae6373&context=custid=1;msisdn=222;headendid=2645;applicationname=website&userid=1&responseformat=json&responselanguage=English&castid=#{result}&mode=SimilarActor&pageno=1"))
      @acotsmovie = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/CastProgrammesByGenre?call=CastProgrammesByGenre&apikey=0ad54e429b2b6238550f24701541130b978e4640&context=custid=1;msisdn=222;headendid=2645;applicationname=website&genre=film&imagesize=medium&pageno=1&userid=1&castid=#{result}&mode=MoviesByActor&responseformat=json&responselanguage=English"))
      render :layout => false
      return false
    elsif params['_escaped_fragment_'] =~ /\/program(.*)/
      programename = CGI::escape(params['_escaped_fragment_'].split("/").last.gsub(/CeNc/,"$#*!").gsub(/DqO/, '"').gsub(/PLus/, '+').gsub(/ObR/, '[').gsub(/CbR/, ']').gsub(/AtR/, '@').gsub(/EmPe/, '&').gsub(/HaSh/, '#').gsub(/StAr/, '*').gsub("-", " ").gsub("~", "-").gsub("$", "/").gsub(/DoLr/, "$").gsub("*", "?").gsub("PeRc", "%"))
      result = JSON.parse(Net::HTTP.get('services.whatsonindia.com',"/UserStar/UserStarHost.svc/ProgrammeIDByName?call=SingleChannelIDByName&apikey=a4d2f0d23dcc84ce983ff9157f8b7f88&responseformat=json&responselanguage=English&context=custid=1;msisdn=222;headendid=2645;applicationname=website&programmename=#{programename}&mode=getProgrammeid&pageno=1&userid=-1"))
      if result["getprogrammeidbyname"]
        result = result["getprogrammeidbyname"]["programmeidbyname"]["programmeid"]
        @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/FullProgrammeDetail?call=FullProgrammeDetail&apikey=74071a673307ca7459bcf75fbd024e09&responseformat=json&responselanguage=English&context=custid=1;msisdn=222;headendid=2645;applicationname=website&pageno=1&programmeimagesize=large&channelimagesize=large&imagesize=large&programmeid=#{result}&starttime=&mode=fullProgrammeDetail&userid=-1"))
        @similarprogrames = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/SimilarProgramme?call=SimilarProgramme&apikey=950a4152c2b4aa3ad78bdd6b366cc179&responseformat=json&responselanguage=English&pageno=1&context=custid=1;msisdn=222;headendid=2645;applicationname=website&programmeimagesize=large&channelimagesize=large&imagesize=large&programmeid=#{result}&mode=similarProgrammes&userid=-1"))
        @castandcrew =  JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/ProgramCastAndCrew?call=ProgramCastAndCrew&apikey=c3c59e5f8b3e9753913f4d435b53c308&responseformat=json&responselanguage=English&context=custid=1;msisdn=222;headendid=2645;applicationname=website&pageno=1&programmeid=#{result}&mode=castNcrew&userid=-1"))
        @webvideos =  JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/WebVideos?call=WebVideos&apikey=9461cce28ebe3e76fb4b931c35a169b0&responseformat=json&responselanguage=English&pageno=1&context=custid=1;msisdn=222;headendid=2645;applicationname=website&imagesize=large&programmeid=#{result}&mode=webVideos&userid=-1"))
        @nextschedule =  JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/MoreProgrammeSchedule?call=MoreProgrammeSchedule&apikey=758874998f5bd0c393da094e1967a72b&responseformat=json&responselanguage=English&pageno=1&context=custid=1;msisdn=222;headendid=2645;applicationname=website&channelimagesize=large&programmeid=#{result}&mode=nextSchedule&userid=-1"))
        @programename =   CGI::unescape(programename)
      else
        @data = {}
        @programename =   CGI::unescape(programename)
      end

      render :layout => false
      return false
    elsif params['_escaped_fragment_'] =~ /\/channel(.*)/
      channelname = CGI::escape(params['_escaped_fragment_'].split("/").last.gsub(/CeNc/,"$#*!").gsub(/DqO/, '"').gsub(/PLus/, '+').gsub(/ObR/, '[').gsub(/CbR/, ']').gsub(/AtR/, '@').gsub(/EmPe/, '&').gsub(/HaSh/, '#').gsub(/StAr/, '*').gsub("-", " ").gsub("~", "-").gsub("$", "/").gsub(/DoLr/, "$").gsub("*", "?").gsub("PeRc", "%"))
      result = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/SingleChannelIDByName?call=SingleChannelIDByName&apikey=6a61d423d02a1c56250dc23ae7ff12f3&responseformat=json&responselanguage=English&context=custid=1;msisdn=222;headendid=2645;applicationname=website&channelname=#{channelname}&mode=getChannelid&pageno=1"))
      if result["getsinglechannelidbyname"]
        result = result["getsinglechannelidbyname"]["singlechannelidbyname"]["channelid"]
        @data = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/SingleChannelDetail?call=SingleChannelDetail&apikey=352fe25daf686bdb4edca223c921acea&responseformat=json&responselanguage=English&pageno=1&channelimagesize=large&channelid=#{result}&context=custid=1;msisdn=222;headendid=2645;applicationname=website;ipaddress=127.0.0.1;useragent=Mozilla/5.0+(X11,+Linux+i686)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/28.0.1500.95+Safari/537.36&mode=channelDetails"))
        @similarchannels = JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/SimilarChannels?call=SimilarChannels&apikey=839ab46820b524afda05122893c2fe8e&responseformat=json&responselanguage=English&pageno=1&context=custid=1;msisdn=222;headendid=2645;applicationname=website&channelimagesize=large&imagesize=large&channelid=#{result}&mode=similarChannels"))
        @toprated =  JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/TopProgrammeForChannel?call=TopProgrammeForChannel&apikey=f90f2aca5c640289d0a29417bcb63a37&responseformat=json&responselanguage=English&context=custid%3D1%3Bmsisdn%3D222%3Bheadendid%3D2645%3Bapplicationname%3Dwebsite&pageno=1&programmeimagesize=large&channelimagesize=large&imagesize=large&channelid=#{result}&languagename=English&hybridgenre=All&mode=channelPopularPrograms"))
        @browse =   JSON.parse(Net::HTTP.get('services.whatsonindia.com', "/UserStar/UserStarHost.svc/ChannelBrowsedProgrammes?call=ChannelBrowsedProgrammes&apikey=98d6f58ab0dafbb86b083a001561bb34&context=custid%3D1%3Bmsisdn%3D222%3Bheadendid%3D2645%3Bapplicationname%3Dwebsite&headendid=2645&userid=196878&channelid=#{result}&imagesize=large&pageno=1&hybridgenre=All&mode=getBrowseForChannel&responseformat=json&responselanguage=English"))
        @channelname =  CGI::unescape(channelname)
      else
        @data = {}
        @channelname =   CGI::unescape(channelname)
      end

      render :layout => false
      return false
    elsif params['_escaped_fragment_'] == "/Search/"
      render :layout => false
      return false
    end

    unless session[:pki]
      @alg = "AES-256-CBC"
      aes = OpenSSL::Cipher::Cipher.new(@alg)
      aes.encrypt
      key = aes.random_key
      @pki = Base64.encode64(key).gsub(/\n/, '')
      session[:pki] = @pki
      session[:key] = key
    end
  end

  def getkey
    render :layout => false
  end


end
#{YOURAPPLIACTION_NAME}::Application.config.secret_token = #{YOUR LONG SECRET TOKEN}