OK, Rails noob asks a question. I am trying to do Rails for the first time here. I am reading Agile Web Dev with Rails 4th ed. I get this error in my box. This works in development mode under webrick, I get an email sent to my gmail and evrything account, but in my apache field in production mode I get this error ...
Errno::ECONNREFUSED in OrdersController
Connection refused - connect(2)
Application Trace ...
app/controllers/orders_controller.rb:58:in `create'
app/controllers/orders_controller.rb:54:in `create'
And so def create in app / controller / order_controller.rb
def create
@order = Order.new(params[:order])
@order.add_line_items_from_cart(current_cart)
respond_to do |format|
if @order.save
Cart.destroy(session[:cart_id])
session[:cart_id] = nil
Notifier.order_received(@order).deliver
format.html { redirect_to(store_url, :notice => I18n.t('.thanks')) }
format.xml { render :xml => @order, :status => :created, :location => @order }
else
format.html { render :action => "new" }
format.xml { render :xml => @order.errors, :status => :unprocessable_entity }
end
end
What happened to my lines 58 and 54? Is this related to my action_mailer settings in app / config / environment.rb?
Here is environment.rb
require File.expand_path('../application', __FILE__)
Depot::Application.initialize!
Depot::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:authentication => "plain",
:user_name => "myemail@gmail.com",
:password => "<password>",
:enable_starttls_auto => true
}
end
Any help is appreciated. Thank.
source
share