我刚刚为我的Ruby on Rails应用程序安装了jQuery UI。它运行Rails 5.我看过所有类似的帖子,但它们不适用于我的案例。未捕获的ReferenceError:未在Rails 5的控制台中定义jQuery
我的页面呈现得很好,但在Chrome开发工具的控制台,我得到这个错误:
我已经重新安排了的application.js文件各种方式,仍然得到同样的错误。这是文件:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery-ui
//= require rails-ujs
//= require html.sortable
//= require turbolinks
//= require_tree .
//= require popper
//= require bootstrap-sprockets
一下如果你把'// =需要其他requries前jquery'? –
@maxpleaner是的,这是原因 –