加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – Heroku没有为rails4预编译资产

发布时间:2020-12-16 19:30:30 所属栏目:百科 来源:网络整理
导读:这里的文档说明了在Rails4中部署期间预编译资产的heroku. 但是, 我没有看到预编译资产消息. 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 int
这里的文档说明了在Rails4中部署期间预编译资产的heroku.

但是,
我没有看到预编译资产消息.

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

我在我的应用程序中遇到了bootstrap的问题,导航栏不能正确加载其他一些细微差别,我认为它是资产预编译问题.

我正在使用Rails4,Ruby2.0

我在application.rb中启用了资产

config.assets.enabled = true

手动预编译没有帮助

heroku run rake assets:precompile

解决方法

有同样的问题.我出于某种原因在本地进行了预编译,然后推送到了Heroku.

Saw Heroku给出了行“检测到清单文件,假设资产是在本地编译的”,这让我意识到它并没有预先编译所有的东西.

当我做了“git add”.并且承诺,我看到它添加了一堆公共文件.把它推到Heroku让它发挥作用.所以我不得不每次都进行预编译和git添加,基本上做了Heroku的工作并在我的公共文件夹中搞乱了.它完成了工作,但是修复得很差.

我查找了heroku提到的“manifest”,并最终在公共目录中找到了“.sprockets-manifest …”文件.

删除了那个,Heroku再次成了我的朋友.

发现这个问题是我研究的一部分,所以我想我会分享我发现的其他人看到这个,或者有任何精心的想法.

现在我必须去看看.sprockets-manifest是否对其他任何东西都很重要….

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读