views:

35

answers:

1

Hi I have a login that after saving the new user is supposed to send an email. This works fine locally but on the production server I keep getting this error in my log files:

ArgumentError (wrong number of arguments (8 for 6)): app/models/user_observer.rb:3:in after_save' /usr/lib64/ruby/1.8/observer.rb:185:innotify_observers' /usr/lib64/ruby/1.8/observer.rb:184:in each' /usr/lib64/ruby/1.8/observer.rb:184:innotify_observers' app/controllers/users_controller.rb:13:in `create'

My user_observer:

class UserObserver < ActiveRecord::Observer 
  def after_save(user)  
   UserMailer.deliver_welcome_email(user)  
  end 
end 

My user_mailer:

class UserMailer < ActionMailer::Base
  def welcome_email(user)  
    recipients user.email 
    from "MilitaryMoveIt <[email protected]>"  
    subject "Welcome to My Awesome Site"  
    sent_on Time.now 
    body :user => user
  end 
end

My user_controller:

  def create
    @user = User.new(params[:user])
    @user_session = UserSession.new
    @user.level = 'Trial'
    if @user.save
      flash[:notice] = "Account registered!"
      redirect_to account_url
    else
      render :layout => 'user_sessions_new', :template => 'user_sessions/new'
    end
  end

I would really appreciate anyone that can shine some light on what I am missing here.

Edit: This is what is being passed: Processing UsersController#create (for 184.40.5.17 at 2010-08-06 12:38:23) [POST] Parameters: {"user"=>{"name"=>"lauren", "password"=>"[FILTERED]", "login"=>"looloobs", "email"=>"[email protected]"}, "x"=>"82", "y"=>"14", "action"=>"create", "authenticity_token"=>"qvQLB9w/pJOWOFzKy6HadbxRieejhQ8Hmry36EAIIwc=", "controller"=>"users"} Sent mail to [email protected]

I have no idea what the X and Y parameters are.. is this the problem, trying to pass these?

A: 

If it's working on locally but not on your production server, do you have the same environment for both? Same Ruby and Rails versions?

What's different about these two environments?

nfm
both environments are running the same versions of ruby and rails. thanks
looloobs