简体   繁体   English

在 Rails 6 中:视差在开发中有效但不在生产中

[英]In Rails 6: Parallax works in development but not in production

The following code works in development but not in production and I'm at a loss.以下代码适用于开发但不适用于生产,我不知所措。 I'm currently deploying production to AWS with capistrano:我目前正在使用 capistrano 将生产部署到 AWS:

.container_parallax {
    text-align: center;
    background-image:url(background1.jpg);
    background-repeat:no-repeat;
    background-size:cover;
    background-attachment: fixed;
    font-family:helvetica, arial, sans-serif;
    line-height:20px;
    min-height: 90vh;
}

The image background1.jpg is in the proper directory app/assets/images/ .图像background1.jpg位于正确的目录app/assets/images/

Thanks in advance for any assistance!在此先感谢您的帮助!

I fixed the problem by making the following change background-image: asset-url('background1.jpg');我通过进行以下更改background-image: asset-url('background1.jpg');解决了这个问题background-image: asset-url('background1.jpg'); . .

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

相关问题 Rails代码在开发中有效,但在生产中无效 - Rails code works in development but not in production Rails Ajax Spinner正在开发中,但未在生产中工作 - rails ajax spinner works in development but not production 方法在开发中有效,但在生产中不起作用Rails MongoDB - Method works in development but not production Rails MongoDB Rails 3:caches_page在开发中起作用,而不在生产中起作用 - Rails 3: caches_page works in development and not in production Rails Log Formatter在开发中可用,但不能在生产中使用 - Rails Log Formatter works in Development, but not Production Rails应用程序在开发中有效,但在生产中为空 - Rails application works in development but is empty in production Rails 5 CarrierWave Gem在生产中工作但不在开发中 - Rails 5 CarrierWave Gem Works in Production But Not In Development Rails:检测用户代理是否在开发中工作但不在生产中? - Rails: Detecting user agent works in development but not production? Rails 4-服务器在开发模式下工作,但不在生产模式下工作 - Rails 4 - server works in development mode, but not in production websocket-rails在开发环境中工作,但不在生产环境中工作 - websocket-rails works in development environment but not production environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM