Project

General

Profile

NoMethodError (undefined method `new' for "sendmail":String) after update to 2.0

Added by Anonymous over 12 years ago

Hi folks,

I set out to install Redmine 2.0 yesterday and did finally succeed, mostly, after some problems:

1) I pulled from the git repo
2) I removed Gemfile.lock and ran bundle install
3) I ran bundle exec rake db:migrate which warned me that I should not have plugins in vendor/plugins/. As moving them as there are to plugins/ did not work either, I decided to move them in a backup folder somewhere for now and try without plugins.
4) I ran rake redmine:plugins:migrate
5) Cleared cash and sessions
6) Restarted thin

Redmine 2.0 came up successfully. I can create a project, create a version in it, but when I want to create an issue, I get an internal server errors and my production logs say

NoMethodError (undefined method `new' for "sendmail":String):
  app/models/mailer.rb:405:in `mail'
  app/models/mailer.rb:48:in `issue_add'
  app/models/mailer.rb:416:in `initialize'
  app/models/mailer.rb:429:in `method_missing'
  app/models/issue_observer.rb:20:in `after_create'
  app/controllers/issues_controller.rb:148:in `create'

To me this looks as if he is trying to send me an email about the new issue, but that fails somehow. My second guess would be that I did not properly unisntal the plugins I head, just moving them out of the folder. I had:

- coderay-0.7.6.227
- coderay-0.9.2
- embedded
- redmine_git_hosting
- redmine_hudson
- redmine-mylyn-connector

Before the upgrade, I had version 1.4.0, but I am not 100% sure creating issues worked in 1.4, as I have not used my redmine much in between (other than looking at some projects...)

Any help or pointers are greatly appreciated.

Also I would like to know if there is a way to get my old plugins to work - or do I have to wait for new versions of each? I can do some simple coding if the changes to be made are small...


Replies (3)

RE: NoMethodError (undefined method `new' for "sendmail":String) after update to 2.0 - Added by Anonymous over 12 years ago

I can confirm this is related to sending notification emails - if you disable it altogether in the administration panel, creating issues works fine. I have also looked at the stack trace, but my Ruby is not good enough to understand what's going on: The line it is complaining about reads

super headers do |format|

and this seems to somehow trigger a call to the method new on an object of class String, which does not exist. At least thatś what it sounds like. I will dig a little deeper and let you know if I find something.

RE: NoMethodError (undefined method `new' for "sendmail":String) after update to 2.0 - Added by Anonymous over 12 years ago

I think I figured it out, though I am not 100% sure what ended up fixing it.I was originally running Ruby 1.8.7 (installed using Ubuntu's package manager). I now uninstalled that and installed 1.9.3 from source, but I don think that was the problem - but a warning when starting up thin in my logfile gave the right tip: It seems it is deprecated to use a file config/email.yml. I had such a file reading

production:
  delivery_method: sendmail

Instead, one should now put that in the config/configuration.yml:

production:
  email_delivery:
     delivery_method: :sendmail

Note the colon (:) in front of :sendmail. I don know ruby or rails well enough, but I am thinking that somehow changes the type of that string, and seems to a a new method which is not there if you do not have the colon.

I have no way of verifying whether it would have sufficed to add that colon, or where the sendmail without colon came from in the first place, but maybe you can try that if you have not tried other solutions yet.

Good luck!

p.s: If someone reads this who knows the internal details of colon vs no colon I would love to hear it - if not I will look it up once I have some time.

    (1-3/3)