Did you turn on the notification? If so, the User model is trying to send an email notification. If you have not configured your mail server, then the create operation will fail.
I had to do the following to solve this problem.
1 Change the user model
Add the dont_notify virtual attribute.
class User < ActiveRecord::Base
2 Modify the Observer code to detect the attribute.
class UserObserver < ActiveRecord::Observer def after_create(user) return if user.dont_notify? #notice this line UserMailer.deliver_signup_notification(user) end def after_save(user) return if user.dont_notify? #notice this line UserMailer.deliver_activation(user) if user.recently_activated? end end
3 Select dont_notify during sowing
In seed.rb set the flag.
User.create(:login => 'admin', :role => Role.find_by_name('super_admin'), :email => ' admin@example.com ', :password => '123123', :password_confirmation => '123123', :dont_notify => true )
source share