small medium large xlarge

11 Nov 2013, 22:35
david phoon (1 post)

I spent almost a week trying to debug this after reading many discussion groups. After checkout and hitting button Place Order I get “We’re sorry, but something went wrong.” with message from the rails server log Errno::ECONNREFUSED (No connection could be made because the target machine actively refused it. - connect(2)): app/controllers/orders_controller.rb:41:in block in create' app/controllers/orders_controller.rb:35:in create’

orders_controller snap shot of create is : ~~~ (Line 35)def create @order = @order.add_line_items_from_cart(current_cart)

respond_to do |format|
	session[:cart_id] = nil
	format.html { redirect_to(store_url, :notice => 'Thank you for your order.' ) }
	format.xml { render :xml => @order, :status => :created,:location => @order }
    format.html { render action: 'new' }
    format.json { render json: @order.errors, status: :unprocessable_entity }
end   end

debugging found the failure of the calling Line 41 to
order_notifier.rb mail to:.....

def shipped(order) @order = order

mail to:, subject: 'Pragmatic Store Order Shipped' ~~~

In production.rb, I have included: ~~~config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :tls => true, :enable_starttls_auto => true, :address => “”, :port => “587”, :domain => “”, :authentication => :plain, # :user_name => “”, # :password => “mygmailpassword” } One discussion was about using telnet to see if there is conflict of ports- to change ports etc.

Also I was able to run and send email using ruby using 587 though I note it is not using the rails server: ~~~ require ‘tlsmail’ require ‘time’

content = «EOF From: To: Subject: Hello! Date: #{}

How are you. EOF

Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) Net::SMTP.start(‘’, 587, ‘’, ‘’, ‘mypassword’, :login) do |smtp| smtp.send_message(content, ‘’, ‘’) end

~~~ any futher pointers getting desperate for answers to send the email.

You must be logged in to comment