So I decided to write my first Rails application.
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.
BUT!
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:
Started GET "/documents" for ..*.* at 2012-12-15 17:58:09 +0400
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)
This is the line that rails refuses to interpret:
return #visible_actions[action_name] if #visible_actions.key?(action_name)
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.
What is wrong?
UPDATE
My routes.rb file:
DiplomaRails::Application.routes.draw do
resources :documents
resources :doc_sets
end
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => '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', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "mongoid", "~> 3.0.0"
Related
I have installed on OS X 10.10.3:
homebrew, command line tools, then installed ruby using rbenv:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
Rails 4.2.2
when I create a new app (with default sqlite database) and try to run it, it says:
=> Booting WEBrick
=> Rails 4.2.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-06-18 23:11:30] INFO WEBrick 1.3.1
[2015-06-18 23:11:30] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
[2015-06-18 23:11:30] INFO WEBrick::HTTPServer#start: pid=41860 port=3000
but in the browser I see:
500 Internal Server Error
If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
log file:
Started GET "/" for ::1 at 2015-06-18 23:11:48 +0300
**ArgumentError (wrong number of arguments (2 for 1)):**
actionpack (4.2.2) lib/action_dispatch/http/request.rb:338:in `parse_query'
rack (1.6.3) lib/rack/request.rb:191:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/request.rb:300:in `GET'
actionpack (4.2.2) lib/action_dispatch/http/parameters.rb:14:in `parameters'
actionpack (4.2.2) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters'
actionpack (4.2.2) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
actionpack (4.2.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.2) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.2) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.2) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.2) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `call'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:819:in `call'
rack (1.6.3) lib/rack/etag.rb:24:in `call'
rack (1.6.3) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.3) lib/rack/head.rb:13:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.3) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.3) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
activerecord (4.2.2) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.1.3) lib/web_console/middleware.rb:37:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.3) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.3) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.3) lib/rack/sendfile.rb:113:in `call'
railties (4.2.2) lib/rails/engine.rb:518:in `call'
railties (4.2.2) lib/rails/application.rb:164:in `call'
rack (1.6.3) lib/rack/lock.rb:17:in `call'
rack (1.6.3) lib/rack/content_length.rb:15:in `call'
rack (1.6.3) lib/rack/handler/webrick.rb:88:in `service'
/Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /Users/smi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.3ms)
Somebody has a similar error? how did you resolve this?
The issue is here: https://github.com/rails/rails/issues/20624
To solve it, change in your Gemfile:
gem 'rack', '1.6.1'
I was getting the same thing, but with Rails 4.2.1, and running on Puma 2.11.3.
I noticed that Bundler just upgraded rack to 1.6.3. Setting the version back to 1.6.2 resolved it for me.
I have RubyMine 4.5 (I also have Idea 12 with Ruby plugin), and Torquebox 2.3. It seems RubyMine doesn't have native support for Torquebox, as it has for Passenger, Trinidad, etc.
I can't figure out how I debug an application on Torquebox server with RubyMine. Any thoughts?
Also:
I tried RubyMine 5 EAP, and it seems it doesn't work out of the box.
I got the following error:
exception:
javax.servlet.ServletException: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ruby/debug/ide
root cause:
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ruby/debug/ide
But the 'ruby-debug-ide' gem is installed.
Don't know is the problem in RubyMine or Torquebox.
Also:
I was able to solve the previous problem by adding the following string to the Gemfile
gem 'ruby-debug-base'
gem 'ruby-debug-ide'
And it seems that debugger attaches to Torquebox server process, but now when app reaches a breakpoint debugger process just silently dies:
Process finished with exit code 143
However Torquebox still works, but gives me a runtime error:
#last_breakpoint supposed to be nil. is #<Debugger::Breakpoint:0x1adad4f>
with the following stacktrace:
ruby-debug-ide (0.4.17.beta16) lib/ruby-debug-ide/event_processor.rb:18:in `at_breakpoint'
ruby-debug-base-0.10.4 (java) lib/ruby-debug-base.rb:43:in `at_breakpoint'
app/controllers/orders_controller.rb:5:in `index'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.2.11) lib/active_support/callbacks.rb:417:in `_run__837017838__process_action__370397448__callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:390:in `_run_process_action_callbacks'
org/jruby/RubyBasicObject.java:1665:in `__send__'
org/jruby/RubyKernel.java:2090:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal.rb:246:in `action'
org/jruby/RubyProc.java:261:in `call'
org/jruby/RubyProc.java:249:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `call'
org/jruby/RubyArray.java:1613:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.4) lib/rack/etag.rb:23:in `call'
rack (1.4.4) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
torquebox-web-2.3.0 (java) lib/torquebox/session/servlet_store.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
activesupport (3.2.11) lib/active_support/callbacks.rb:408:in `_run__521886712__call__4409452__callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:390:in `_run_call_callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.4) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.4) lib/rack/runtime.rb:17:in `call'
rack (1.4.4) lib/rack/lock.rb:15:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
org/jruby/RubyBasicObject.java:1665:in `__send__'
org/jruby/RubyKernel.java:2090:in `send'
railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
Withal I got hundreds IDE errors related to jruby.
Edit:
After fixing Gemfile with appropriate versions of gems:
gem 'ruby-debug-base', '>= 0.10.5.rc3'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'
Debugger seemed to be working, but when I got an exception in my app, debugger crashed: process died, and I got the following:
#last_breakpoint supposed to be nil. is #<Debugger::Breakpoint:0x1d91ad6>
I suppose I better wait for RubyMine 5 RC.
According to this comment it's already implemented and will be available in RubyMine 5.0 and next IDEA plug-in.
You can already try it in RubyMine 5.0 EAP.
Please check the name of your folder. The name of your project should be normal. Once I use "jim's project" under OSX system as the project folder name, the error above occurs. After changing to "jims project", everything is fine.
Since I upgraded my app to ruby 1.9.2 I got the following error :
I'm running ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
TypeError (class DateTime needs to have method `_load'):
activesupport (3.2.1) lib/active_support/message_verifier.rb:45:in `load'
activesupport (3.2.1) lib/active_support/message_verifier.rb:45:in `verify'
actionpack (3.2.1) lib/action_dispatch/middleware/cookies.rb:288:in `[]'
actionpack (3.2.1) lib/action_dispatch/middleware/session/cookie_store.rb:53:in `block in unpacked_cookie_data'
actionpack (3.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
actionpack (3.2.1) lib/action_dispatch/middleware/session/cookie_store.rb:51:in `unpacked_cookie_data'
rack (1.4.1) lib/rack/session/cookie.rb:98:in `extract_session_id'
actionpack (3.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `block in extract_session_id'
actionpack (3.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
actionpack (3.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `extract_session_id'
rack (1.4.1) lib/rack/session/abstract/id.rb:43:in `load_session_id!'
rack (1.4.1) lib/rack/session/abstract/id.rb:32:in `[]'
rack (1.4.1) lib/rack/session/abstract/id.rb:262:in `current_session_id'
rack (1.4.1) lib/rack/session/abstract/id.rb:268:in `session_exists?'
rack (1.4.1) lib/rack/session/abstract/id.rb:107:in `exists?'
rack (1.4.1) lib/rack/session/abstract/id.rb:122:in `load_for_read!'
rack (1.4.1) lib/rack/session/abstract/id.rb:64:in `has_key?'
actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:258:in `ensure in call'
actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:259: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.1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.1) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__3195440498508246587__call__1658952344890015472__callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.1) 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'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.1) lib/rails/engine.rb:479:in `call'
railties (3.2.1) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/Users/guillaumenm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/guillaumenm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/guillaumenm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
I created a new rails App, no issues launching it. I was not having any issues before.
Here's my gem file. Any help would be very welcome.
Thanks
source :gemcutter
gem 'oauth2'
gem 'faraday'
gem "koala", "~> 1.2.0beta"
gem 'json'
gem "rails", "3.2.1"
gem "sqlite3-ruby", :require => "sqlite3"
gem 'songkickr'
gem 'httparty'
gem "squeel" , "~> 0.9.5"
group :development do
gem 'dalli' #To use memcached
gem 'newrelic_rpm'
gem 'rails-web-console', :require => 'console'
gem 'heroku'
end
gem 'event-calendar', :require => 'event_calendar'
gem 'delayed_job', '2.1.4'
gem 'icalendar'
gem 'acts_as_tree'
gem 'active_scaffold'
gem 'prototype-rails'
gem 'prototype_legacy_helper', '0.0.0' , :git => 'git://github.com/rails/prototype_legacy_helper.git'
gem "state_machine"
Just downgraded my app to my previous working rails 3.1.2, no more success. Related to ruby 1.9.2 upgrade.
Found the answer on stackoverflow :
Local server error after upgrading ruby from 1.8.7 to 1.9.2 (with Rails 3.1.1)
Clear your cookies: your app is storing the session (which is a marshalled ruby object) in a cookie. If i remember correctly he marshal format changed between 1.8 and 1.9, so your app can no longer load old sessions
A chance my app was not a production app, or I could've had many users getting these errors...
While updating a production app, I was able to work around the issue by clearing all sessions:
DELETE FROM sessions;
(from the DB using SQL -- so the users don't have to clear their cookies)
Something similar happened to me recently. After some debugging (even debugging the ruby code to confirm), my conclusion was that the plist4r gem was modifying the String class, making it user-serializable (). After an update, when we dropped our dependency of plist4r, the String instances were reverted back to system-deserializable. But the serialized streams still required String instances to be user-deserializable hence the error.
For me it was the case of plist4r and String class https://github.com/dreamcat4/plist4r/blob/master/lib/plist4r/backend/ruby_cocoa.rb
There might be some other cases as well.
The solution for us was to invalidate all the sessions (data/cookies) thus removing the need to deserialize those streams.
I was initially using Devise to handle authentication on my application but as I'm switching to a password-less, completely OpenID/OAuth authentication system, I decided to remove Devise.
I started by "destroy"ing the models,views, removed the gem from the Gemfile, removed the initializer file (config/initializers/devise.rb) and a locale file I found (config/locales/devise.en.yml)
I've look through the stack and the source code (GREP'ed it all) and couldn't find any reference to devise.
The problem is that now my application keeps returning me this error:
No such file or directory - /home/develop/0523a/fivetalk/config/locales/devise.en.yml
Does anyone have an idea of where the problem is?
Here's the stack
activesupport (3.0.3) lib/active_support/file_update_checker.rb:25:in `stat'
activesupport (3.0.3) lib/active_support/file_update_checker.rb:25:in `updated_at'
activesupport (3.0.3) lib/active_support/file_update_checker.rb:25:in `map'
activesupport (3.0.3) lib/active_support/file_update_checker.rb:25:in `updated_at'
activesupport (3.0.3) lib/active_support/file_update_checker.rb:29:in `execute_if_updated'
activesupport (3.0.3) lib/active_support/i18n_railtie.rb:23:in `_callback_before_5'
activesupport (3.0.3) lib/active_support/callbacks.rb:414:in `_run_prepare_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:45:in `call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `send'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213:in `start'
railties (3.0.3) lib/rails/commands/server.rb:65:in `start'
railties (3.0.3) lib/rails/commands.rb:30
railties (3.0.3) lib/rails/commands.rb:27:in `tap'
railties (3.0.3) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
(super delayed)
I had to follow the steps described in the question, and after that I needed to restart the server, which I hand't done. This was the solution for the problem. Just in case other people see this and don't read the comments.
Okay. I'm past my wit here.
I've got a rails app that I haven't worked on in about 3 weeks...yet when I left off it did not produce this error anywhere.
I am using the latest versions of many gems yet all of them seem to be working. I'm working under ruby1.9 now and so I upgraded things to match that. I am reasonably sure that is the only significant thing to change since 3 weeks ago.
Many pages render just fine, but one page fails with a NoMethodError "undefined method `children' for nil:NilClass" and the following seemingly framework-only stack trace. For the page in question I have gone so far as to comment out the entire haml page, the controller method, all before_filters, all of application_controller, and a few other things.
I've downgraded haml and compass suspecting that they were the culprits even though other pages render just fine. I'm currently back to the stable branches on everything except, I think devise, but that doesn't seem to be part of the issue because logins work just fine.
activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in `method_missing'
haml (3.1.1) lib/haml/parser.rb:151:in `parse'
haml (3.1.1) lib/haml/engine.rb:124:in `initialize'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `new'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `compile'
haml (3.1.1) lib/haml/template/plugin.rb:39:in `call'
actionpack (3.0.7) lib/action_view/template.rb:226:in `compile'
actionpack (3.0.7) lib/action_view/template.rb:134:in `block in render'
activesupport (3.0.7) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.7) lib/action_view/template.rb:127:in `render'
actionpack (3.0.7) lib/action_view/render/rendering.rb:59:in `block in _render_template'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_view/render/rendering.rb:56:in `_render_template'
actionpack (3.0.7) lib/action_view/render/rendering.rb:26:in `render'
haml (3.1.1) lib/haml/helpers/action_view_mods.rb:13:in `render_with_haml'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:115:in `_render_template'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:109:in `render_to_body'
actionpack (3.0.7) lib/action_controller/metal/renderers.rb:47:in `render_to_body'
actionpack (3.0.7) lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:102:in `render_to_string'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:93:in `render'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:17:in `render'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
activerecord (3.0.7) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:39:in `render'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:14:in `default_render'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:6:in `send_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.7) lib/active_support/callbacks.rb:436:in `_run__1376965243214072245__process_action__2201785587746499238__callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.7) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
sass (3.1.1) lib/sass/plugin/rack.rb:54:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.2) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.2) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.2) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.2) lib/rack/content_length.rb:13:in `call'
rack (1.2.2) lib/rack/handler/webrick.rb:52:in `service'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
I am starting to think that the change to ruby 1.9.2 has caused this but I can't think how it would. I'm going to pull back to ruby 1.8.7 so I can get working again (hopefully) but our production server runs 1.9.2 so I'll need it at some point.
Any thoughts are appreciated.
Thanks
Edit Downgrading to Ruby1.8.7 Had no effect. I also tried it on another computer without RVM.
Edit Gemfile as requested:
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mysql'
gem "will_paginate", "~> 3.0.pre2"
gem 'activemerchant'
gem 'devise', '1.1.9'
gem 'ruby-debug'
gem 'sslrequirement'
gem 'cancan'
gem 'rmagick'
gem 'carrierwave', "~> 0.5.3"
gem 'haml'
gem 'compass'
#gem 'mongrel'
gem 'jquery-rails'
group :development, :test do
gem 'webrat'
gem 'wirble'
end
Do you use HAML comments (-#)? Removing them worked for me.