简体   繁体   English

引导程序没有样式

[英]Bootstrap is not styling anything

I am using Bootstrap but it is not styling anything for some reason. 我正在使用Bootstrap,但是由于某种原因它没有设置任何样式。

I've tried pasting the bootstrap code for forms and navbars into my home view and it just shows like normal without the bootstrap styling. 我尝试将表单和导航栏的引导程序代码粘贴到我的主视图中,但没有引导程序样式时,它就像正常显示一样。

I have 我有

@import "bootstrap"; @import“引导程序”; in my stylesheet 在我的样式表中

and the appropriate gems in my Gemfile. 以及我的Gemfile中合适的宝石。 Is there some part of the setup that I am forgetting? 我忘记了设置的某些部分吗? Or why would it not be working. 还是为什么它不起作用。 I've used it in past projects just a few days ago but not sure why it is not styling anything this time around. 我几天前才在过去的项目中使用过它,但是不确定为什么这次没有样式。

This is my GEMfile: 这是我的GEMfile:

source 'https://rubygems.org'


gem 'bootstrap-sass', '~> 3.1.1'

gem 'simple_form'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

make sure you bundle install or bundle (default to install) and add version to critical gems. 确保bundle installbundle (默认为安装),然后将版本添加到重要的gem。

Also try 也试试

rake temp:clear

我没有将我的application.css文件重命名为application.css.scss,这是我的问题:/尽管现在已解决!

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

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