Problem activating emails; undefined method `each' for nil:NilClass

Added by Martin Neubauer over 10 years ago

Hello,

i have installed Redmine under Ubuntu 1.04 = Lucid with Passenger.
Redmine itself runs very well with my migrated data.

I get trouble when i do this:
-coping *email.yml to /etc/redmine/default and doing an apache restart

Then i cant access to redmine because:
Ruby on Rails application could not be started
Error message:
undefined method `each' for nil:NilClass
Exception class:
NoMethodError
Application root:
/usr/share/redmine

I would be glad about any hints. Thank you!

*

production:
delivery_method: :sendmail
#delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25

Backtrace: # File Line Location
0 /usr/share/redmine/config/initializers/40-email.rb 12
1 /usr/share/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb 144 in `load_without_new_constant_marking'
2 /usr/share/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb 144 in `load'
3 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 550 in `load_application_initializers'
4 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 549 in `each'
5 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 549 in `load_application_initializers'
6 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 167 in `process'
7 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 112 in `send'
8 /usr/share/redmine/vendor/rails/railties/lib/initializer.rb 112 in `run'
9 /usr/share/redmine/config/environment.rb 43
10 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require'
11 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require'
12 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 299 in `preload_application'
13 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 248 in `initialize_server'
14 /usr/lib/ruby/1.8/phusion_passenger/utils.rb 255 in `report_app_init_status'
15 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 233 in `initialize_server'
16 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 194 in `start_synchronously'
17 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 163 in `start'
18 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb 209 in `start'
19 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 262 in `spawn_rails_application'
20 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 126 in `lookup_or_add'
21 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 256 in `spawn_rails_application'
22 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 80 in `synchronize'
23 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'
24 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 255 in `spawn_rails_application'
25 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 154 in `spawn_application'
26 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb 287 in `handle_spawn_application'
27 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 352 in `__send__'
28 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 352 in `main_loop'
29 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb 196 in `start_synchronously'
30 /usr/lib/phusion_passenger/passenger-spawn-server 61

Replies (6)

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Felix Schäfer over 10 years ago

Please paste your email.yml between < pre> < /pre> tags (without the extra spaces, obviously) so that we can see the formatting correctly.

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Martin Neubauer over 10 years ago

Because i had no email.yml.example on the system i took one from the svn as the master.
I have no more active lines... most of them have a "#"

1st Part:

# = Outgoing email settings
#
# Each environment has it's own configuration options.  If you are only
# running in production, only the production block needs to be configured.
#
# == Common configurations
#
# === Sendmail command
#
# production:
#   delivery_method: :sendmail
#
# === Simple SMTP server at localhost
#
  production:
  delivery_method: :sendmail
  #delivery_method: :smtp
  smtp_settings:
  address: "localhost" 
  port: 25
#
# === SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
#
# production:
#   delivery_method: :smtp
#   smtp_settings:
#     address: "example.com" 
#     port: 25
#     authentication: :login
#     domain: 'foo.com'
#     user_name: 'myaccount'
#     password: 'password'
#
# xx
# yy
#
...

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Felix Schäfer over 10 years ago

No, the point was to have the exact formatting you have in your file. Notice the indentation in the examples? Yaml is indentation sensitive, you need to indent each level 2 blanks more than the level above that.

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Martin Neubauer over 10 years ago

Thank you very much. I solved the problem*s*

i never heard this before:

indentation sensitive

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Felix Schäfer over 10 years ago

Martin Neubauer wrote:

Thank you very much. I solved the problem*s*

i never heard this before:

indentation sensitive

Call it indentation aware if you prefer, more info about yaml here: http://en.wikipedia.org/wiki/YAML#Syntax

RE: Problem activating emails; undefined method `each' for nil:NilClass - Added by Anonymous about 10 years ago

I wonder which idiot ever invented indentation sensitive files

(1-6/6)