rails 生产 'css 未预编译' [英] rails production 'css isn't precompiled'

查看:44
本文介绍了rails 生产 'css 未预编译'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Leopard 网络服务器上使用生产在姊妹 Rails 3.1 应用程序上完成了这项工作.所以我没想到在部署这个应用程序时会如此迷失.我已经让乘客识别该应用程序,但我在 apache 中收到[GET/] 小姐"错误.环顾四周,我想我可以让它在 webrick 中运行,看看我是否可以隔离问题.

I've done this on a sister Rails 3.1 app using production on my Leopard webserver. So I didn't expect to be this lost deploying this app. I've gotten Passenger to recognize the app, but I get a '[GET /] miss' error in apache. Looking around I figure I can get this to run in webrick to see if I can isolate the issue.

bundle exec rake assets:precompile RAILS_ENV=production

bundle exec rake assets:precompile RAILS_ENV=production

但是当我加载 localhost:3000 时,我得到blueprint/screen.css is not precompiled"

But when I load up localhost:3000 I get "blueprint/screen.css isn't precompiled"

我开始比较姐妹应用之间的差异,但找不到它们.以下是他们共享的一些关键代码:

I start comparing the differences between the sister apps and cannot find them. Here are some key code they share:

<%= stylesheet_link_tag "application" %>
  <%= javascript_include_tag "application" %> #in app/views/layouts/application.html.erb

config/environments/production.rb
config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.precompile += %w( search.js )
  config.assets.precompile += %w( blueprint/screen.css blueprint/print.css )
  config.assets.precompile += %w( *.css *.js )

这发生在 3.1.0 和 3.1.3 中,我可以确认预编译发生在蓝图目录中.我在俯瞰什么?,山姆

This happens in 3.1.0 and 3.1.3 and I can confirm the precompile happens on the blueprint directories. What am I overlooking?, sam

推荐答案

你有没有像这样分开试过?

Have you tried separately like this?

config.assets.precompile += %w( blueprint/screen.css )
config.assets.precompile += %w( blueprint/print.css )

然后运行:

bundle exec rake assets:precompile RAILS_ENV=production

这应该修复它.

这篇关于rails 生产 'css 未预编译'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆