- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在推送到 heroku 时,我在预编译 Assets 时遇到了问题。特别是我目前代码中的一点点 javascript。根据我读到的一些东西,我尝试了 rake assets:clobber 然后再次预编译。这样做之后,我的 CSS 仍然存在于我的代码中,但页面在生产和开发中只呈现 HTML。我还尝试删除浏览器缓存以及让其他人从另一个确认了相同问题的站点访问该应用程序。老实说,我不确定到底要在这里显示什么,因为我真的不知道问题出在哪里,所以如果您需要查看其他任何内容,请告诉我。似乎一切都完好无损。我还没有找到这个问题的满意答案,希望能提供一些意见。谢谢。
一些来自生产的源代码有错误
head:after {
font-family: sans-serif;
font-size: large;
font-weight: bold;
content: "Error compiling CSS asset";
}
body:before, body:after {
font-family: monospace;
white-space: pre-wrap;
}
body:before {
font-weight: bold;
content: "\000a Sass::SyntaxError: Invalid CSS after \0022 \002f *\0022 : expected \0022 \002f \0022 , was \0022 * This is a man...\0022 \000a (in \002f app\002f app\002f assets\002f stylesheets\002f application.css)";
}
body:after {
content: "\000a (sass):1";
}
自定义.css.scss
@import " Bootstrap ";
/
* mixins, variables, etc. */
$grayMediumLight: #eaeaea;
@mixin box_sizing {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* universal */
html {
overflow-y: scroll;
}
.container {
max-width: 1170px;
margin-right: auto;
margin-left: auto;
box-sizing: border-box;
}
div {
display: block;
}
section {
overflow: auto;
}
textarea {
resize: vertical;
}
.center {
text-align: center;
}
.center h1 {
margin-bottom: 10px;
}
/* typography */
h1, h2, h3, h4, h5, h6 {
line-height: 1;
}
h1 {
font-size: 3em;
letter-spacing: -2px;
margin-bottom: 30px;
text-align: center;
}
h2 {
letter-spacing: -1px;
margin-bottom: 30px;
text-align: center;
font-weight: 500;
font-size: 93px;
color: white;
font-family: Helvetica;
}
.hero-unit {
padding: 60px;
margin-bottom: 30px;
font-size: 18px;
font-weight: 200;
line-height: 30px;
color: inherit;
background-color: #eeeeee;
}
p {
font-size: 1.1em;
line-height: 1.7em;
}
/* Header */
.btn-lg {
color: white;
background-color: transparent;
margin-top: 20px;
}
.col-lg-6 {
width: 50%;
margin-top: 60px;
color: white;
}
#home-header {
background-image: url("firepit_80opac.png");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: 841px;
display: block;
}
.header-description h2 {
font-weight: 100;
font-family: inherit;
font-size: 93px;
color: rgb(255, 255, 255);
text-shadow: 0 0px 12px rgba(36, 36, 36, 0.55);
padding: 0px 0 4px 0;
}
#logo {
float: left;
margin-top: 20px;
font-size: 1.7em;
color: #fff;
text-transform: uppercase;
letter-spacing: -1px;
font-weight: bold;
line-height: 1;
&:hover {
color: white;
text-decoration: none;
}
}
.navbar-inner ul li {
display: inline-block;
padding: 10px 15px 10px;
}
.header-btn {
color: white;
margin: 0px auto;
text-transform: uppercase;
width: 20%;
font-weight: 300;
font-size: 24px;
padding: 20px 35px;
border: 2px solid rgb(219, 82, 47);
background: rgb(219, 82, 47);
display: block;
-webkit-border-radius: 9px;
border-radius: 9px;
text-align: center;
}
.header-btn:hover {
background-color: transparent;
color: white;
text-decoration: none;
}
.header-description {
margin: 100px 0 80px;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
/* site header */
.nav li a {
color: #db522f;
}
/* home-footer */
.row.home-footer {
margin-right: auto;
margin-left: auto;
display: block;
height: 200px;
background: rgb(243, 243, 243);
position: relative;
}
.col-md-4 {
width: 33.3%;
margin-right: -15px;
margin-left: 15px;
}
.col-md-4 {
color: rgb(124, 124, 124);
}
/* carousel */
#quote-carousel
{
padding: 0 10px 30px 10px;
margin-top: 30px;
}
/* Control buttons */
#quote-carousel .carousel-control
{
background: none;
color: #222;
font-size: 2.3em;
text-shadow: none;
margin-top: 30px;
}
/* Previous button */
#quote-carousel .carousel-control.left
{
left: -12px;
}
/* Next button */
#quote-carousel .carousel-control.right
{
right: -12px !important;
}
/* Changes the position of the indicators */
#quote-carousel .carousel-indicators
{
right: 50%;
top: auto;
bottom: 0px;
margin-right: -19px;
}
/* Changes the color of the indicators */
#quote-carousel .carousel-indicators li
{
background: #c0c0c0;
}
#quote-carousel .carousel-indicators .active
{
background: #333333;
}
#quote-carousel img
{
width: 250px;
height: 100px
}
/* End carousel */
.item blockquote {
border-left: none;
margin: 0;
}
.item blockquote img {
margin-bottom: 10px;
}
.item blockquote p:before {
content: "\f10d";
font-family: 'Fontawesome';
float: left;
margin-right: 10px;
}
/**
MEDIA QUERIES
*/
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
#quote-carousel
{
margin-bottom: 0;
padding: 0 40px 30px 40px;
}
}
/* Small devices (tablets, up to 768px) */
@media (max-width: 768px) {
/* Make the indicators larger for easier clicking with fingers/thumb on mobile */
#quote-carousel .carousel-indicators {
bottom: -20px !important;
}
#quote-carousel .carousel-indicators li {
display: inline-block;
margin: 0px 5px;
width: 15px;
height: 15px;
}
#quote-carousel .carousel-indicators li.active {
margin: 0px 5px;
width: 20px;
height: 20px;
}
}
生产.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = true
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
# Generate digests for assets URLs.
config.assets.digest = true
# `config.assets.precompile` has moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: Rails.application.secrets.domain_name,
authentication: "plain",
enable_starttls_auto: true,
user_name: Rails.application.secrets.email_provider_username,
password: Rails.application.secrets.email_provider_password
}
# ActionMailer Config
config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
开发.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = false
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: Rails.application.secrets.domain_name,
authentication: "plain",
enable_starttls_auto: true,
user_name: Rails.application.secrets.email_provider_username,
password: Rails.application.secrets.email_provider_password
}
# ActionMailer Config
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
# Send email in development mode?
config.action_mailer.perform_deliveries = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end
最佳答案
这里是愚蠢的错误。我不小心删除了 application.css 文件中的一个字符。用 * 而不是 */。
关于javascript - CSS 在 rake Assets :clobber 后不呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24873314/
我正在 Windows 上运行具有多个作业 (-j4) 的 make。在构建结束时,我让 Jenkins 抓取控制台日志并收集编译器警告的数量和类型。问题(我认为)是多个 make 作业都具有相同的标
我对 DOM Clobbering 的话题有一些疑问: Portswigger 对此进行了解释: window.onload = function(){ let someObject =
我正在尝试内联汇编的示例:http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html但是有些东西让我对破坏感到困惑:
我在 VSCodium 中使用 git,每次我尝试 pull git 时都在提示。 查看我看到的日志 > git pull --tags origin master From https://gith
我试图理解为什么以下代码会生成“参数可能被破坏……”警告。这是一个最小的示例: #include extern char ** environ; int test_vfork(char **args
我觉得我快疯了。谁能帮忙? 我有文件夹 c:\project\bin我运行以下命令来执行我的 rake 脚本 cd C:\project rake 在我的抽佣脚本中我有: require 'rake/
我正在努力获取一些 x86 程序集以在 Core 2 Duo Mac 上进行编译。对于如下语句,使用 clang 会返回无效操作数错误: asm volatile ("subl %0,%%esp" :
如何从命令行更改 perforce 规范?我想要做的是,我有一个工作区,其 clobber 选项设置为 noclobber (默认值)。现在我想将其更改为 clobber。 我知道我可以直接从 p4v
我正在学习 ARM 内联汇编,并对一个非常简单的函数感到困惑:将 x 的值分配给 y (两者都是 int 类型),在arm32 和arm64 上为什么需要不同的clobber 描述? 这是代码: #i
我正在学习 ARM 内联汇编,并对一个非常简单的函数感到困惑:将 x 的值分配给 y (两者都是 int 类型),在arm32 和arm64 上为什么需要不同的clobber 描述? 这是代码: #i
来自关于 Extended ASM - Clobbers and Scratch Registers 的 GCC 文档我发现很难理解以下解释和示例: Here is a fictitious sum
为什么Coverity会产生警告 > "cc" clobber ignored 对于下面提到的代码中的函数调用 htons() 和 ntohs()? lSocketAddr.sin_port = ht
谁能告诉我“make clean”和“make clobber”之间的区别?我进行了搜索,但没有找到有用的答案。 最佳答案 这两个术语都没有固定的含义。 Makefile 作者创建目标并赋予它们人类可
我读到,如果我们在 clobber 列表中指定“cc”,则表示汇编代码修改了标志寄存器 编写了一个示例程序来检查添加“cc”和不添加之间的区别。 比较程序集,当我们添加“cc”时没有变化。 #incl
我阅读了有关 GCC 内联汇编器的文章(http://www.ethernut.de/en/documents/arm-inline-asm.html)。 在本文中,“内存”Clobber 强制编译器
正如这个问题的标题中提到的,当我出于临时原因修改 asm 语句中的一些寄存器时,在 clobber 和 dummy 输出之间哪个选项更好? 例如,我在 link 中实现了两个版本的交换功能, 并发现两
如果我使用 call 指令,通过 C++ 代码中的 GNU 内联汇编程序,调用一个我知道使用 __stdcall 约定的函数,我是否必须列出任何注册为破坏? 我在互联网上找不到很好的指导,但看起来 %
在推送到 heroku 时,我在预编译 Assets 时遇到了问题。特别是我目前代码中的一点点 javascript。根据我读到的一些东西,我尝试了 rake assets:clobber 然后再次预
我基本上确信我遇到了一些 g++ 4.8.3 错误,但我想我会先问这个列表,因为我对 setjmp/longjmp 的经验很少。我已将相关代码简化为以下 foo.cxx: #include #inc
在实现无锁数据结构和时序代码时,通常需要抑制编译器的优化。通常人们使用 asm volatile 和 clobber 列表中的 memory 来执行此操作,但有时您只会看到 asm volatile
我是一名优秀的程序员,十分优秀!