Html 赫罗库没有';无法在CSS中获得本地更改
我有个奇怪的问题。 我的heroku应用程序没有从CSS获取本地更改。 但它从.html.erb文件中获取所有更改。 例如:如果我在custom.css中编写bodyHtml 赫罗库没有';无法在CSS中获得本地更改,html,css,ruby-on-rails,ruby,heroku,Html,Css,Ruby On Rails,Ruby,Heroku,我有个奇怪的问题。 我的heroku应用程序没有从CSS获取本地更改。 但它从.html.erb文件中获取所有更改。 例如:如果我在custom.css中编写body{background:black!important},则背景仅在本地为黑色,在heroku应用程序中为正常。 但是如果我在.html.erb文件中写入body style=“background:black},我将得到更改。 我该怎么办? 你需要我的gem、CSS或SCSS文件吗 我的档案 source 'https://rub
{background:black!important}
,则背景仅在本地为黑色,在heroku应用程序中为正常。
但是如果我在.html.erb文件中写入body style=“background:black}
,我将得到更改。
我该怎么办?
你需要我的gem、CSS或SCSS文件吗
我的档案
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use sqlite3 as the database for Active Record
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'devise'
gem 'jquery-turbolinks', '~> 2.1'
gem "rest-client"
gem 'will_paginate'
gem 'bootstrap-will_paginate'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
gem 'heroku-deflater'
# gem 'unicorn'
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'sqlite3'
# Use SCSS for stylesheets
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
application.css
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require bootstrap
*= require_tree .
*= require_self
*= require_custom
*/
顺便说一句,我删除了gemfile中的
gem'sass-rails',“~>5.0”
,它开始工作。但这很奇怪,所以我很想知道问题出在哪里。运行rails\u ENV=production bundle exec-rake-assets:precompile
在将你的应用程序上传到Heroku之前预编译你的资产。你能分享你的production.r吗b
、application.css
和gem
文件?@SzilardMagyar是的,5秒=)您是否预编译了您的资产?@SzilardMagyar请参阅更新)@MarcK。我以为资产是自动预编译的。我该怎么做?
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require bootstrap
*= require_tree .
*= require_self
*= require_custom
*/