Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3.2.9 different outputs from different domains
    text
    copied!<p>So I decided to write my first Rails application.</p> <p>Set up locally, added Mongoid to make it rich with data, added route to documents#index, launched rails -s in development mode - on localhost everything works fine, i see a beautiful list of documents available at my demand.</p> <p>BUT!</p> <p>My IP is visible from outside world, so I attached it to a domain from no-ip.org. Opened the same page and saw this terrifying stacktrace:</p> <p>Started GET "/documents" for <em>.</em>.*.* at 2012-12-15 17:58:09 +0400</p> <pre><code>NoMethodError (undefined method `key?' for nil:NilClass): actionpack (3.2.9) lib/action_controller/metal/hide_actions.rb:36:in `visible_action?' actionpack (3.2.9) lib/action_controller/metal/hide_actions.rb:18:in `method_for_action' actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:14:in `method_for_action' actionpack (3.2.9) lib/action_controller/metal/compatibility.rb:61:in `method_for_action' actionpack (3.2.9) lib/abstract_controller/base.rb:115:in `process' actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in `process' actionpack (3.2.9) lib/action_controller/metal.rb:203:in `dispatch' actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' actionpack (3.2.9) lib/action_controller/metal.rb:246:in `block in action' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `call' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `dispatch' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in `call' journey (1.0.4) lib/journey/router.rb:68:in `block in call' journey (1.0.4) lib/journey/router.rb:56:in `each' journey (1.0.4) lib/journey/router.rb:56:in `call' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' rack (1.4.1) lib/rack/etag.rb:23:in `call' rack (1.4.1) lib/rack/conditionalget.rb:25:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in `call' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in `call' activerecord (3.2.9) lib/active_record/query_cache.rb:64:in `call' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `_run__413099900__call__336258148__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_call_callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.9) lib/rails/rack/logger.rb:32:in `call_app' railties (3.2.9) lib/rails/rack/logger.rb:16:in `block in call' activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in `tagged' railties (3.2.9) lib/rails/rack/logger.rb:16:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.1) lib/rack/methodoverride.rb:21:in `call' rack (1.4.1) lib/rack/runtime.rb:17:in `call' activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.1) lib/rack/lock.rb:15:in `call' actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in `call' railties (3.2.9) lib/rails/engine.rb:479:in `call' railties (3.2.9) lib/rails/application.rb:223:in `call' rack (1.4.1) lib/rack/content_length.rb:14:in `call' railties (3.2.9) lib/rails/rack/log_tailer.rb:17:in `call' rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service' C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms) Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms) Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (23.0ms) </code></pre> <p>This is the line that rails refuses to interpret:</p> <pre><code>return @visible_actions[action_name] if @visible_actions.key?(action_name) </code></pre> <p>The more - the better, when I launched my server in Production mode, both localhost and custom domain spat the same stack trace in my face.</p> <p>What is wrong?</p> <p><strong>UPDATE</strong> My routes.rb file:</p> <pre><code>DiplomaRails::Application.routes.draw do resources :documents resources :doc_sets end </code></pre> <p>My Gemfile:</p> <pre><code>source 'https://rubygems.org' gem 'rails', '3.2.9' # Bundle edge Rails instead: # gem 'rails', :git =&gt; 'git://github.com/rails/rails.git' # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '~&gt; 3.2.3' gem 'coffee-rails', '~&gt; 3.2.1' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms =&gt; :ruby gem 'uglifier', '&gt;= 1.0.3' end gem 'jquery-rails' gem "mongoid", "~&gt; 3.0.0" </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload