0

Pivotal Web ServicesでPumaを使用してRails 5.1.3を実行しています。ActionController :: RoutingError "/ cloudfoundryapplication"の[GET]と[OPTION]と一致するルートはありません

1. ActionController::RoutingError (No route matches [GET] "/cloudfoundryapplication") 
2. ActionController::RoutingError (No route matches [OPTION] "/cloudfoundryapplication") 

私は考え出し、外部アプリケーションピボタルの「/ cloudfoundryapplication」のそれのようにすべての詳細を見つけることができません:Railsの4からこのバージョンにアップグレードしているので、私は次のエラーがログに表示され見ていますCross-Origin Resource Sharing(CORS)に関連している可能性があります。私は問題を解決しようとするために 'rack-cors'宝石を使用しました。その結果、[OPTION]エラーは消えてしまいましたが、[GET]エラーは消えませんでした。ここで

は私のconfig/application.rbです:

require_relative 'boot' 

require "rails" 
# Pick the frameworks you want: 
require "active_model/railtie" 
require "active_job/railtie" 
require "action_controller/railtie" 
require "action_mailer/railtie" 
require "action_view/railtie" 
require "sprockets/railtie" 
require "rails/test_unit/railtie" 
require 'pdfkit' 

# Require the gems listed in Gemfile, including any gems 
# you've limited to :test, :development, or :production. 

Bundler.require(*Rails.groups) 

module MyFaro 
    class Application < Rails::Application 
    # Initialize configuration defaults for originally generated Rails version. 
    config.load_defaults 5.1 

    # 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 = 'Brussels' 

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

    #config.skylight.probes += %w(mongoid mongo) 

    config.middleware.use PDFKit::Middleware, {:print_media_type => true}, :only => %r[/print_story] 

    config.after_initialize do 
     ApplicationController.helpers.cache_set_look_up_hash 
     ApplicationController.helpers.cache_set_system_parameter_hash 
    end 
    end 
end 

、私のconfig /環境/ production.rb:

Rails.application.configure do 
    # Settings specified here will take precedence over those in config/application.rb. 

    #CORS 
    config.middleware.insert_before 0, Rack::Cors do 
    allow do 
     origins '*' 
     resource '*', :headers => :any, :methods => [:get, :post, :options] 
    end 
    end 

    # Code is not reloaded between requests. 
    config.cache_classes = true 

    # Eager load code on boot. This eager loads most of Rails and 
    # your application in memory, allowing both threaded web servers 
    # and those relying on copy on write to perform better. 
    # Rake tasks automatically ignore this option for performance. 
    config.eager_load = true 

    # Full error reports are disabled and caching is turned on. 
    config.consider_all_requests_local  = false 
    config.action_controller.perform_caching = true 
    config.cache_store = :memory_store 

    # Attempt to read encrypted secrets from `config/secrets.yml.enc`. 
    # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or 
    # `config/secrets.yml.key`. 
    config.read_encrypted_secrets = true 

    # Disable serving static files from the `/public` folder by default since 
    # Apache or NGINX already handles this. 
    config.public_file_server.enabled = true 

    # Compress JavaScripts and CSS. 
    config.assets.js_compressor = :uglifier 
    # config.assets.css_compressor = :sass 

    # Do not fallback to assets pipeline if a precompiled asset is missed. 
    config.assets.compile = true 

    # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 

    # Enable serving of images, stylesheets, and JavaScripts from an asset server. 
    # config.action_controller.asset_host = 'http://assets.example.com' 

    # Specifies the header that your server uses for sending files. 
    # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 
    # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 

    # Mount Action Cable outside main process or domain 
    # config.action_cable.mount_path = nil 
    # config.action_cable.url = 'wss://example.com/cable' 
    # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 

    # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 
    config.force_ssl = true 

    # Use the lowest log level to ensure availability of diagnostic information 
    # when problems arise. 
    config.log_level = :error 

    # Prepend all log lines with the following tags. 
    config.log_tags = [ :request_id ] 

    # Use a different cache store in production. 
    # config.cache_store = :mem_cache_store 

    # Use a real queuing backend for Active Job (and separate queues per environment) 
    # config.active_job.queue_adapter  = :resque 
    # config.active_job.queue_name_prefix = "my_faro_#{Rails.env}" 
    config.action_mailer.perform_caching = false 

    # Ignore bad email addresses and do not raise email delivery errors. 
    # Set this to true and configure the email server for immediate delivery to raise delivery errors. 
    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.default_url_options = { host: 'http://myfaro.cfapps.io/'} 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.smtp_settings = { 
     address: 'smtp.mailgun.org', 
     port: 587, 
     authentication: 'plain', 
     #domain: 'sandboxe3e6f1cfc3d34efc8dba23c1a1eaff8b.mailgun.org', 
     domain: 'mg.myfaro.be', 
     #user_name: '[email protected]', 
     user_name: '[email protected]', 
     #password: '25c695256391ca3e9f6c6bb1dd9f622f' 
     password: 'f1d6d58994362f084cc2ecac0e46256c' 
    } 
    # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 
    # the I18n.default_locale when a translation cannot be found). 
    config.i18n.fallbacks = true 
    config.i18n.available_locales = [:en,:nl,:fr,:de] 

    # Send deprecation notices to registered listeners. 
    config.active_support.deprecation = :notify 

    # Use default logging formatter so that PID and timestamp are not suppressed. 
    config.log_formatter = ::Logger::Formatter.new 

    # Use a different logger for distributed setups. 
    # require 'syslog/logger' 
    # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 

    if ENV["RAILS_LOG_TO_STDOUT"].present? 
    logger   = ActiveSupport::Logger.new(STDOUT) 
    logger.formatter = config.log_formatter 
    config.logger = ActiveSupport::TaggedLogging.new(logger) 
    end 

end 
+0

同じhttps://github.com/pivotal-cf/pcfdev/issues/253について1つの問題が報告されています –

答えて

0

私はピボタルサポートチームからの回答を得ました。

ピボットウェブサービスのAppsマネージャは、/ cloudfoundryapplicationエンドポイントをSpring Boot Actuatorインテグレーションのルートとして使用します。 AppsマネージャのSpring起動アクチュエータのエンドポイントを設定しているかどうかにかかわらず、AppsマネージャのUIでアプリケーションを表示すると、このエンドポイントが呼び出されます。

したがって、Spring Boot Actuatorエンドポイントを使用しないアプリケーションの場合、これらのエラーはAppsマネージャGUIを使用している間のみ表示されます。

そのようなSchrodingers冷蔵庫の光の猫:あなたが見ていなければ、エラーは表示されません。 CLIを介してログをチェックしたが、実際にはエラーは全くない。

関連する問題