1

我是 Heroku 的新手。当我在本地运行这个 rails 应用程序时,它工作正常,当我部署到 heroku 时,它会中断。请看图片。我在该图像内指向箭头。


在这里本地工作正常,它假设以这种方式工作。 在此处输入图像描述


CSS 在这里破坏了图像,并且不应该是这样的。只发生在 Heroku 服务器中。 在此处输入图像描述


我在 rails 应用程序中有多个 CSS 文件,其中大约 9 个。
我正在使用带有 Ruby 1.9.3 的 Rails 3.2

我一直在尝试解决这个问题并到处寻找这个解决方案,但没有运气。之前还好好的,不知道怎么回事?

任何帮助表示赞赏,如果解决了,我会将答案标记为正确。

谢谢!

更新:当我做 git push heroku 时,这就是我所看到的:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_9a6529a8-57cd-4fb0-9cc0-39ebfcdb2c7a/Rakefile:7)
       Asset precompilation completed (105.95s)

在 application.css 中,我看到了

/*
*= require_self
*= require_tree .
*/

/* rest of file omitted */
4

1 回答 1

2

这可能与资产管道有关。

确保 application.css 需要您的所有资产或添加到

config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']

在 application.rb 中。

资产在本地运行时编译,但不在生产环境中编译。

编辑:为了让 active_admin 发挥出色,不要将其包含在 application.css 中,即:删除

require_tree .

并分别要求每个文件/目录。

于 2013-10-04T17:32:16.653 回答