问题描述
这里的文档说明了在Rails4中部署时使用预编译资源的heroku。
但是,
我看不到预编译资产消息。
使用thin(1.6.1)
使用twitter-bootstrap-rails(2.2.8)
使用uglifier(2.3.1)
使用will_paginate(3.0.4)
您的包已完成!它已安装到./vendor/bundle
捆绑包完成(1.37s)
清理捆绑包缓存。
----->编写config / database.yml以从DATABASE_URL读取
检测到的清单文件,假设资产是在本地编译的
----->发现过程类型
Procfile声明类型 - > (无)
Ruby的默认类型 - >控制台,耙,网络,工人
我在应用程序中遇到引导问题,不会加载正确+一些其他细微差别,我认为它的资产预编译问题。
我使用Rails4,Ruby2.0
我在application.rb中启用了资源
config.assets.enabled = true
手动预编译并没有帮助
heroku run rake assets:precompile
删除public /资产文件夹帮助。我还跑了英雄运行耙子资产:干净。
之后我可以看到:
---->编写config / database.yml以从DATABASE_URL读取
----->为Rails资产管道准备应用程序
正在运行:rake资产:预编译
!
The documentation here says that heroku with pre-compile assets during deployement in Rails4.
However , I dont see the precompile assets message.
Using thin (1.6.1)
Using twitter-bootstrap-rails (2.2.8)
Using uglifier (2.3.1)
Using will_paginate (3.0.4)
Your bundle is complete! It was installed into ./vendor/bundle
Bundle completed (1.37s)
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
Detected manifest file, assuming assets were compiled locally
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby -> console, rake, web, worker
I am facing issues with bootstrap in my app, where the nav bar wont load properly + some other nuances and I think its the asset precompile issue.
I am using Rails4, Ruby2.0
I have assets enabled in application.rb
config.assets.enabled = true
Precompiling manually did not help
heroku run rake assets:precompile
Deleting the public/assets folder helped. Also I ran heroku run rake assets:clean.
After that I could see:
----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
The navbar loads fine now !
这篇关于Heroku不预先编译rails4的资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!