gpt4 book ai didi

javascript - Bootstrap-sass gem Javascript 不能在 Rails 4 中工作

转载 作者:太空宇宙 更新时间:2023-11-03 17:52:39 24 4
gpt4 key购买 nike

使用 bootstrap-sass gem 时,我已正确加载我的 css 文件,但是当我尝试加载 javascript 文件时收到错误。我已按照从 https://github.com/twbs/bootstrap-sass 加载 javascript 的过程进行操作然而,当我在本地主机上查看我的网页时

我收到错误“找不到文件‘bootstrap’”

这就是我的 application.js 文件的样子 - 任何帮助将不胜感激!
应用程序.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, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, 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.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
// Loads all Bootstrap javascripts
//= require bootstrap
//= require_tree .

最佳答案

来自 Rails 4 :assets group isn't used anymore ,请从 Gemfile 中删除该组:

Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading. You should also update your application file (in config/application.rb):

Bundler.require(:default, Rails.env)

关于javascript - Bootstrap-sass gem Javascript 不能在 Rails 4 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21413618/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com