简体   繁体   English

ActionController :: RoutingError(没有路由匹配“/javascripts/rails.js”)

[英]ActionController::RoutingError (No route matches “/javascripts/rails.js”)

I am using the jquery gem and have installed everything which removes proton. 我正在使用jquery gem并安装了一切可以移除质子的东西。

I am getting this error and I don't understand why? 我收到此错误,我不明白为什么?

ActionController::RoutingError (No route matches "/javascripts/rails.js")

I see it in the log. 我在日志中看到它。

Any ideas. 有任何想法吗。

Thanks. 谢谢。

I've just fixed a similar problem -- after updating my bundle (including jquery-rails) and running rails generate jquery:install (updating jquery itself). 我刚刚解决了类似的问题 - 更新我的包(包括jquery-rails)和运行rails generate jquery:install (更新jquery本身)。 As far as I understand, rails.js is now replaced by jquery_ujs.js (I'm not sure it is a smart move though). 据我所知,rails.js现在被jquery_ujs.js取代(我不确定这是一个聪明的举动)。

You should go on and eliminate any references to rails.js in your app, two possible places to look in are: 您应该继续并删除应用程序中对rails.js的任何引用,两个可能的位置是:

config/application.rb — you can probably remove the config.action_view.javascript_expansions[:defaults] = %w(jquery rails) line completely config/application.rb - 您可以完全删除config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

and

app/views/layouts/application.* — you should have a != javascript_include_tag :defaults line there and not references to jquery or rails . app/views/layouts/application.* - 你应该有一个!= javascript_include_tag :defaults行,而不是jqueryrails引用。

What environment are you running (dev/test/prod) ? 你在运行什么环境(dev / test / prod)? If it's prod, is your Rails app configured to serve the static assets? 如果它是prod,您的Rails应用程序是否配置为提供静态资产?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM