【问题标题】:Heroku rejecting an app production.rb:94: syntax error, unexpected keyword_end, expecting end-of-inputHeroku 拒绝应用程序 production.rb:94:语法错误,意外的关键字结束,期待输入结束
【发布时间】:2016-07-01 10:03:56
【问题描述】:

我正在尝试将我的应用程序推送到 Heroku,它具有邮件功能,但由于我看不到的缺失端而拒绝它。此外,该应用程序在使用 gmail 的本地环境中运行良好。

配置/环境/生产

    ils.application.configure do

  config.cache_classes = true
  config.eager_load = true
  config.consider_all_requests_local       = false
  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
  config.assets.js_compressor = :uglifier
  config.assets.compile = false
  config.assets.digest = true
  config.log_level = :debug
  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
  config.log_formatter = ::Logger::Formatter.new
  config.active_record.dump_schema_after_migration = false

  config.action_mailer.default_url_options = {  host: "https://personal-blog22.herokuapp.com " }
  config.action_mailer.delivery_method = :smtp
  config.action_controller.perform_caching = false
  config.action_mailer.smtp_settings = {
    address:               "smtp.gmail.com",
    port:                   587,
    domain:                "ruby.blog100.com",
    user_name:             "XXXXXXX@gmail.com",
    password:              "XXXXX",
    authentication:        :plain,
    enable_starttls_auto:  true
  }
end

配置/环境/开发

 For better error to work on Vagrant VM
BetterErrors::Middleware.allow_ip! "0.0.0.0/0"

Rails.application.configure do

  config.cache_classes = false
  config.eager_load = false
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.action_mailer.raise_delivery_errors = true
  config.consider_all_requests_local = true
  config.active_support.deprecation = :log
  config.active_record.migration_error = :page_load
  config.assets.debug = true
  config.assets.digest = true
  config.assets.raise_runtime_errors = true
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
  config.action_mailer.perform_deliveries = true
  config.action_mailer.delivery_method = :smtp
  config.action_controller.perform_caching = false
  config.action_mailer.smtp_settings = {
    address:               "smtp.gmail.com",
    port:                   587,
    domain:                "ruby.blog100.com",
    user_name:             "XXXX@gmail.com",
    password:              "XXXXX",
    authentication:        :plain,
    enable_starttls_auto:  true
  }
end

config/application.rb

    require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module PersonalBlog
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

    # Do not swallow errors in after_commit/after_rollback callbacks.
    config.active_record.raise_in_transactional_callbacks = true
  end
end

【问题讨论】:

  • production.rb 的第 94 行是什么?
  • @Aleksey 没有第 94 行 :) 它们只有 28 行!
  • 显示您看到的错误消息的实际回溯。

标签: ruby-on-rails ruby ruby-on-rails-4 heroku


【解决方案1】:

问题只是 Git 而不是代码!。它并没有推动我对我的应用所做的更改。

【讨论】:

    猜你喜欢
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    • 2019-11-02
    • 2015-11-26
    • 1970-01-01
    相关资源
    最近更新 更多