Errno :: ECONNREFUSED в OrdersController # create

Хорошо, Rails noob задает вопрос. Я здесь впервые пытаюсь сделать Rails. Я читаю Agile Web Dev with Rails, 4-е изд. Я получаю эту ошибку в своей производственной коробке. Это работает в режиме разработки под webrick, я получаю письмо, отправленное на мою учетную запись gmail и все, но на моем сервере apache в производственном режиме я получаю эту ошибку ...

Errno::ECONNREFUSED in OrdersController#create
Connection refused - connect(2)

Трассировка приложения ...

app/controllers/orders_controller.rb:58:in `create'
app/controllers/orders_controller.rb:54:in `create'

И вот def создайте в app / controllers / order_controller.rb

def create
@order = Order.new(params[:order])
@order.add_line_items_from_cart(current_cart)

respond_to do |format|  #THIS IS LINE 54
  if @order.save
    Cart.destroy(session[:cart_id]) 
    session[:cart_id] = nil 
    Notifier.order_received(@order).deliver     #THIS IS LINE 58
    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

Что не так с моими строками 58 и 54? Связано ли это с моими настройками action_mailer в app / config / environment.rb?

Вот environment.rb

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Depot::Application.initialize!

#uncertain about anything below this line

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

Любая помощь приветствуется. Спасибо.

5
задан thefonso 17 August 2011 в 18:53
поделиться