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

ruby-on-rails – 如何在Heroku上的rails应用程序上完全关闭资产

发布时间:2020-12-17 02:38:58 所属栏目:百科 来源:网络整理
导读:我有一个rails应用程序,它运行没有资产的服务.当我部署时,我看到: ----- Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! could not connect to server: Connection refused Is the server running on host "127.0.
我有一个rails应用程序,它运行没有资产的服务.当我部署时,我看到:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       could not connect to server: Connection refused
       Is the server running on host "127.0.0.1" and accepting
       TCP/IP connections on port 5432?
       /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
       /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
       /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'
...

所以我把它放到我的application.rb中:

config.assets.enabled = false
config.serve_static_assets = false
config.assets.compile = false

但是在部署时我仍然得到相同的消息.

如何在heroku上完全关闭资产编译/处理?

解决方法

请参阅 this question和 the docs.看起来像manifest.yml文件中的魔术.

(编辑:李大同)

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

    推荐文章
      热点阅读