为 Rails 应用程序在本地加载 CSS 但不在 Heroku 中加载 [英] CSS loading locally but not in Heroku for a rails app

查看:30
本文介绍了为 Rails 应用程序在本地加载 CSS 但不在 Heroku 中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 rails prelaunch 注册教程.Bootstrap 部署在 heroku 上运行良好,但随后我修改了 bootstrap_and_override 文件以包含徽标.在本地启动 rails 服务器并查看时,样式与我预期的一样,引导程序和新标题徽标出现.

I'm following a rails prelaunch signup tutorial. Bootstrap was working fine deployed on heroku, but then I modified the bootstrap_and_override file to include a logo. When launching a rails server locally and viewing, the style is as I intended with bootstrap and the new header logo appearing.

像我以前一样,我运行 rake assets:precompile 并推送到 git - 遵循本教程 http://railsapps.github.com/rails-heroku-tutorial.html 在 heroku 上显示 css 之前工作.html 正在显示,但看起来缺少 css 和 bootstrap.

Like I did before, I ran rake assets:precompile and pushed to git - followed this tutorial http://railsapps.github.com/rails-heroku-tutorial.html which worked before showing the css while on heroku. The html is showing but it looks like css and bootstrap are missing.

有人有什么想法吗?

推荐答案

在本地代码上运行 bundle exec rake assets:precompile

提交更改并部署到heroku

Commit the changes and deploy to heroku

这篇关于为 Rails 应用程序在本地加载 CSS 但不在 Heroku 中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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