Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 映像url未在临时环境中添加摘要_Ruby On Rails_Ruby_Sass - Fatal编程技术网

Ruby on rails 映像url未在临时环境中添加摘要

Ruby on rails 映像url未在临时环境中添加摘要,ruby-on-rails,ruby,sass,Ruby On Rails,Ruby,Sass,当我为登台环境运行assets:precompile时,它不会向资产添加摘要。但是,它在生产中运行良好 这是我的scss代码的要点: .hero-unit { background: image-url('slide-living-room.jpg'); background-size: cover; height: 50rem; } 输出: .hero-unit{background:url(/assets/slide-living-room.jpg);background-si

当我为登台环境运行
assets:precompile
时,它不会向资产添加摘要。但是,它在生产中运行良好

这是我的scss代码的要点:

.hero-unit {
  background: image-url('slide-living-room.jpg');
  background-size: cover;
  height: 50rem;
}
输出:

.hero-unit{background:url(/assets/slide-living-room.jpg);background-size:cover;height:50rem}
正如您所看到的,它并没有向生成的链接添加摘要。我在下面附上了我的项目的更多技术细节

config/environments/staging.rb

config.assets.css_compressor = :sass
config.assets.digest = true
Gemfile

gem 'rails', '4.1.6'
gem 'sass-rails', '~>4.0.3'
Ruby:2.1.2 轨道:4.1.6


设置中可能有什么错误?

我通过运行

bundle exec rake assets:clobber
每次我都在预编译这些资产。它正在使用缓存副本重新生成它,这导致了问题。运行clobber将清除整个链轮缓存并完全生成资产