意外的tLABEL(SyntaxError) - learn-rails

时间:2015-03-24 17:12:38

标签: ruby-on-rails

尝试使用localhost:3000时出现SyntaxError错误。谢谢,我花了很多时间研究,找不到正确的答案。

/Users/matt/.rvm/gems/ruby-2.2.1@learn-rails/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': /Users/matt/workspace/learn-rails/config/environments/development.rb:37: syntax error, unexpected tLABEL (SyntaxError)
...ions = { :host => ’localhost:3000’ } 
                                  ^

我的代码:

    Rails.application.configure do
    config.assets.debug = true
    config.action.mailer.smtp_settings = {
        address: “smtp.gmail.com”,
        port: 587,
        domain: Rails.application.secrets.domain_name,
        authentication: “plain”,
        user_name: Rails.application.secrets.email_provider_username,
        password: Rails.application.secrets.email_porvider_password
        }

  # ActionMailer Config
      config.action_mailer.default_url_options = { :host => ’localhost:3000’ } 
      config.action_mailer.delivery_method = :smtp
      config.action_mailer.raise_delivery_errors = true

  # Send email in development mode?
      config.action_mailer.perform_deliveries = true 
      config.action_mailer.default :charset => "utf-8"   
    end

1 个答案:

答案 0 :(得分:2)

您使用的是错误的引号。

’localhost:3000’

需要

'localhost:3000'