Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionController::RoutingError (No route matches [OPTIONS] "/assets") #18513

Closed
zpaulovics opened this issue Jan 14, 2015 · 4 comments
Closed

Comments

@zpaulovics
Copy link

Hi,

In a Rails 4.2 application I have changed config parameter in the config/environments/porduction.rg file
from config.serve_static_assets = false
to config.serve_static_files = false
according to the deprication message. Since that time I have got the following fatal error:

I, [2015-01-14T12:43:41.747355 #22151] INFO -- : Started OPTIONS "/assets/" for 91.120.37.4 at 2015-01-14 12:43:41 +0100
F, [2015-01-14T12:43:41.756075 #22151] FATAL -- :
ActionController::RoutingError (No route matches [OPTIONS] "/assets"):
vendor/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' vendor/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:incall'
vendor/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in call_app' vendor/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:22:incall'
vendor/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in call' vendor/ruby/2.2.0/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:incall'
vendor/ruby/2.2.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in call' vendor/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:incall'
vendor/ruby/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in call' vendor/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/ssl.rb:24:incall'
vendor/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in call' vendor/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:incall'
/home/tamop614/.rvm/gems/ruby-2.2.0@trainer/gems/passenger-4.0.57/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in process_request' /home/tamop614/.rvm/gems/ruby-2.2.0@trainer/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request'
/home/tamop614/.rvm/gems/ruby-2.2.0@trainer/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:109:in main_loop' /home/tamop614/.rvm/gems/ruby-2.2.0@trainer/gems/passenger-4.0.57/lib/phusion_passenger/request_handler.rb:455:inblock (3 levels) in start_threads'

@rafaelfranca
Copy link
Member

Can you please provide a sample application that reproduces the error?

@senny
Copy link
Member

senny commented Apr 24, 2015

@zpaulovics It's been some time without feedback. Do you still experience that problem? If so, please provide a sample application to reproduce the problem, this goes a long way in debugging the issue.

@zpaulovics
Copy link
Author

Hi, unfortunately I could not reproduce the problem.

@fjfish
Copy link

fjfish commented Jul 20, 2015

You see this when the remote app sends an OPTIONS http verb. I'm hitting this using the Ionic framework from a phone - I think it's some kind of check to see if the host will accept XSS. You can get match to give you the verb thus:

match '/v1/phone/register', to: 'v1_phone#options', as: :phone_register_options, via: :options

and the options method looks like this

def options
  headers['Access-Control-Allow-Origin'] = request.env['HTTP_ORIGIN']
  headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
  headers['Access-Control-Max-Age'] = '1000'
  headers['Access-Control-Allow-Headers'] = '*,x-requested-with'
  head :ok
end

I've got past this now but still fighting with the JavaScript in Ionic asking for options and then not doing the second call for data. I hope this helps someone else make some progress :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants