.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `initialize': No such file or directory - getaddrinfo (Errno::ENOENT) - ruby-on-rails-3.1

I got this error when I tried to run: rake db:migrate, rake schema:load and rails s. The application I git cloned from Bitbucket is unusable and the client is unable to help.
I have reinstalled ruby and gemset and it didn't work. I have no idea how to fix this error. Please help. What is causing the error and where I can find information that might help me fixing it?
Errno::ENOENT
No such file or directory - getaddrinfo
Rails.root: /home/jacek/Programming/Rails/idea-academy
Application Trace | Framework Trace | Full Trace
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `initialize'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `open'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:644:in `connect'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:626:in `start'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:1168:in `request'
newrelic_rpm (3.3.3) lib/new_relic/agent/instrumentation/net.rb:22:in `block in request_with_newrelic_trace'
newrelic_rpm (3.3.3) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
newrelic_rpm (3.3.3) lib/new_relic/agent/instrumentation/net.rb:21:in `request_with_newrelic_trace'
copycopter_client (2.0.1) lib/copycopter_client/client.rb:49:in `block in download'
copycopter_client (2.0.1) lib/copycopter_client/client.rb:113:in `connect'
copycopter_client (2.0.1) lib/copycopter_client/client.rb:46:in `download'
copycopter_client (2.0.1) lib/copycopter_client/cache.rb:101:in `download'
copycopter_client (2.0.1) lib/copycopter_client/request_sync.rb:17:in `call'
newrelic_rpm (3.3.3) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
newrelic_rpm (3.3.3) lib/new_relic/rack/developer_mode.rb:24:in `call'
sass (3.1.15) lib/sass/plugin/rack.rb:54:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.3) lib/rack/etag.rb:23:in `call'
rack (1.3.3) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.2) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.3) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.3) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.1) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
rails-dev-tweaks (0.6.1) lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:in `call'
rack (1.3.3) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.3) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.3) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.3.3) lib/rack/urlmap.rb:52:in `block in call'
rack (1.3.3) lib/rack/urlmap.rb:46:in `each'
rack (1.3.3) lib/rack/urlmap.rb:46:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.3) lib/rack/handler/webrick.rb:59:in `service'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/jacek/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

This is a very old thread but I think I've found what was wrong.
When you use net/http and try to instantiate a new object passing the URL string http = Net::HTTP.new("http://127.0.0.1:4567"), you'll get this error.
you have to instantiate using an URI object, just like:
uri = URI.parse("http://localhost:4567")
http = Net::HTTP.new(uri.host, uri.port)

Did you install all the gems it needs?
did you do bundle install?
gem install bundler
bundle

Related

Rails 'parse_query' error on server in brand new app

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.

How do I set up a rails production server using ruby on rails?

I started learning about ruby on rails and heroku and I have come to the problem of not being able to see the newly created app in heroku. I tried running the server locally by using the command:
rails server
The app showed on the browser successfully but when I type the command
rails server -e production
The browser displays an error saying "The page you were looking for doesn't exist...". This is the same error I get when I try accessing the app through heroku. I'm very new to heroku and ruby on rails so I'm not sure where to go from here.
The console shows this when I try the -e production option
ActionController::RoutingError (No route matches [GET] "/"):
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
The solution to this problem is to add an index to your root. Like this example shows: Link

Rails 3.2.9 different outputs from different domains

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"

Problems removing Devise from an application

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.

undefined method `children' for nil:NilClass

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.

Resources