Project

General

Profile

Problem with email.yml

Added by Jonathan BIEBER almost 14 years ago

Hi,
I have only this in the email.yml :

production:
delivery_method: :smtp
smtp_settings:
address: localhost
port: 25
domain: adh.fr
authentication: :none

And when I want to start ruby service I have this error :

/var/www/rails/redmine/config/initializers/40-email.rb:12: undefined method `each' for nil:NilClass (NoMethodError)
from /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `load_without_new_constant_marking'
from /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `load'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:622:in `load_application_initializers'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:621:in `each'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:621:in `load_application_initializers'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:176:in `process'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /var/www/rails/redmine/script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /var/www/rails/redmine/config/environment.rb:20
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
from /var/www/rails/redmine/vendor/rails/railties/lib/commands/server.rb:84
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/www/rails/redmine/script/server:3

If I start ruby service with email.yml it works. Help me please


Replies (9)

RE: Problem with email.yml - Added by Felix Schäfer almost 14 years ago

YAML (files ending in .yml are generally in this format) are indentation sensitive, 2 spaces per extra level, and you seem to have missed the extra level under smtp_settings. Try:

production:
  delivery_method: :smtp
  smtp_settings:
    address: localhost
    port: 25
    domain: adh.fr
    authentication: :none

RE: Problem with email.yml - Added by Jonathan BIEBER almost 14 years ago

Hey, thanks you very much it works !!

RE: Problem with email.yml - Added by Jonathan BIEBER almost 14 years ago

I have just another question about messenger plugin, my messenger.yml is the next :

production: &production
type: xmpp4r
jid: jbieber@webserver
password: darkjohn
host: webserver
port: 5222
ssl: false
debug: false

test:
type: mock

production:
<<: *development

But, when I want to execute rake db:migrate_plugins I see an error was occured:

rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

What is the problem ?

RE: Problem with email.yml - Added by Felix Schäfer almost 14 years ago

Jonathan BIEBER wrote:

production: &production
  type: xmpp4r
  jid: jbieber@webserver
  password: darkjohn
  host: webserver
  port: 5222
  ssl: false
  debug: false

test:
  type: mock

production:
  <<: *development

You do realize you have 2 production environments and that you try to include a non-existant development environment in the second, don't you?

RE: Problem with email.yml - Added by Jonathan BIEBER almost 14 years ago

I have only one production environment, it's true I don't have development environment.
But it not works after this modifications. Apparently, I must create a jabber user but I don't know how to process this.

RE: Problem with email.yml - Added by Felix Schäfer almost 14 years ago

Jonathan BIEBER wrote:

I have only one production environment, it's true I don't have development environment.

No.

production: &production
  type: xmpp4r
  jid: jbieber@webserver
  password: darkjohn
  host: webserver
  port: 5222
  ssl: false
  debug: false

Here you have a production environment.

test:
  type: mock

production:
  <<: *development

There you have another production environment that references a development anchor (the *development part).

Your file should probably look like:

development: &development
  type: xmpp4r
  jid: jbieber@webserver
  password: darkjohn
  host: webserver
  port: 5222
  ssl: false
  debug: false

test:
  type: mock

production:
  <<: *development

RE: Problem with email.yml - Added by Jonathan BIEBER almost 14 years ago

Ok thanks for this answer, but I have an other error

rake aborted!
thread 0xb75d31b4 tried to join itself

Jabber sends this error I think it's the last, I hope

RE: Problem with email.yml - Added by Felix Schäfer almost 14 years ago

Is this with rake --trace already? Anyway, if that's a problem with the plugin, please contact the plugin author.

RE: Problem with email.yml - Added by Jonathan BIEBER almost 14 years ago

With rake --trace I have this :

root@webserver:/var/www/rails/redmine# rake db:migrate_plugins --trace
(in /var/www/rails/redmine)
  • Invoke db:migrate_plugins (first_time)
  • Invoke environment (first_time)
  • Execute environment
    Exception caught in Parser thread!
    rake aborted!
    thread 0xb75981b8 tried to join itself
    /usr/local/lib/site_ruby/1.8/xmpp4r/connection.rb:63:in `lock'
    /usr/local/lib/site_ruby/1.8/xmpp4r/connection.rb:63:in `accept_features'
    /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
    /usr/local/lib/site_ruby/1.8/xmpp4r/connection.rb:61:in `accept_features'
    /usr/local/lib/site_ruby/1.8/xmpp4r/connection.rb:56:in `connect'
    /usr/local/lib/site_ruby/1.8/xmpp4r/client.rb:73:in `connect'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/me ssengers/xmpp4r_messenger.rb:76:in `connect'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/me ssengers/xmpp4r_messenger.rb:17:in `initialize'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/me ssenger.rb:81:in `new'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/me ssenger.rb:81:in `create_messenger'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/me ssenger.rb:61:in `method_missing'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/lib/redmine_messenger/ba se.rb:76:in `register_handler'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/app/messengers/timers_me ssenger.rb:7
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:380:in `load_without_new_constant_marking'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:380:in `load_file'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:521:in `new_constants_in'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:379:in `load_file'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:259:in `require_or_load'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:224:in `depend_on'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:136:in `require_dependency'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/init.rb:23:in `evaluate_ init_rb'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/init.rb:22:in `each'
    /var/www/rails/redmine/vendor/plugins/redmine_messenger/init.rb:22:in `evaluate_ init_rb'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin.rb:158:i n `evaluate_init_rb'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/core_ext/ke rnel/reporting.rb:11:in `silence_warnings'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin.rb:154:i n `evaluate_init_rb'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
    /var/www/rails/redmine/config/../vendor/plugins/engines/lib/engines/plugin.rb:44 :in `load'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin/loader.r b:38:in `load_plugins'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin/loader.r b:37:in `each'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/rails/plugin/loader.r b:37:in `load_plugins'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
    /var/www/rails/redmine/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
    /var/www/rails/redmine/config/environment.rb:20
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:156:in `require'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:521:in `new_constants_in'
    /var/www/rails/redmine/vendor/rails/activesupport/lib/active_support/dependencie s.rb:156:in `require'
    /var/www/rails/redmine/vendor/rails/railties/lib/tasks/misc.rake:4
    /usr/lib/ruby/1.8/rake.rb:636:in `call'
    /usr/lib/ruby/1.8/rake.rb:636:in `execute'
    /usr/lib/ruby/1.8/rake.rb:631:in `each'
    /usr/lib/ruby/1.8/rake.rb:631:in `execute'
    /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/rake.rb:607:in `invoke_prerequisites'
    /usr/lib/ruby/1.8/rake.rb:604:in `each'
    /usr/lib/ruby/1.8/rake.rb:604:in `invoke_prerequisites'
    /usr/lib/ruby/1.8/rake.rb:596:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/rake.rb:583:in `invoke'
    /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
    /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2029:in `each'
    /usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
    /usr/lib/ruby/1.8/rake.rb:2001:in `run'
    /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:1998:in `run'
    /usr/bin/rake:28

I contact the plugin author now, thanks you again

    (1-9/9)