Bootstrap-sass gem Javascript 在 Rails 4 中不起作用 [英] Bootstrap-sass gem Javascript not Working in Rails 4

查看:57
本文介绍了Bootstrap-sass gem Javascript 在 Rails 4 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 bootstrap-sass gem 时,我已经正确加载了我的 css 文件,但是当我尝试加载 javascript 文件时收到了一个错误.我遵循了从 https://github.com/twbs/bootstrap-sass 但是,当我在 localhost

上查看我的网页时,收到错误找不到文件‘引导程序’"

这就是我的 application.js 文件的样子 - 任何帮助将不胜感激!
应用程序.js

when using the bootstrap-sass gem i have loaded my css files properly, however have been receiving an error when i try loading the javascript files. I have followed the procedure of loading javascript from https://github.com/twbs/bootstrap-sass however when I view my webpage on localhost

I receive the error "couldn't find file 'bootstrap'"

This is what my application.js file looks like - Any help would be much appreciated!
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, 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 .

推荐答案

我通过从 gemfile 的资产组中删除 gem 'bootstrap-sass', '~> 3.0.3.0' 使其工作!耶

I got it to work by removing gem 'bootstrap-sass', '~> 3.0.3.0' out of the assets group in gemfile! YAY

这篇关于Bootstrap-sass gem Javascript 在 Rails 4 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆