2014-03-01 56 views
0

此应用程序是使用Rails Composer生成的,至今尚未制作任何Mod。这是我以前使用过MySQL的第一个使用Postgres的应用程序。当我试图在本地运行它时,它最初失败了,因为PG正在监听端口5433,并且该应用试图连接到端口5432.我将PG改为监听5432而不是5433.此时,它开始工作。在本地,我可以注册,登录和列出用户。这就是它现在所做的一切,因为我没有修改原始代码。Heroku推Rails4 Postgres应用程序未能编译Ruby应用程序

当我:

git push heroku master 

它的工作,直到我得到的消息:

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? 
... trace dump ... 
! 
!  Precompiling assets failed. 
! 

!  Push rejected, failed to compile Ruby app 

To [email protected]:afternoon-spire-5707.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:afternoon-spire-5707.git' 

耙资产:预编译本地工作:

D:\BitNami\rubystack-2.0.0-11\projects\keyandcar>rake assets:precompile 
I, [2014-03-01T01:06:01.849873 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/application-2523f7871b800324a0dde9f6d33ef208.js 
I, [2014-03-01T01:06:01.919922 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/application-5d552226c05f29080fc1703e860817a5.css 
I, [2014-03-01T01:06:01.936932 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/bootstrap/glyphicons-halflings-regular-171c97066e4db52896df4e14c2905e8e.eot 
I, [2014-03-01T01:06:01.949941 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/bootstrap/glyphicons-halflings-regular-e327cd5918c69ba34cb1c92b9c7c424a.svg 
I, [2014-03-01T01:06:01.981961 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/bootstrap/glyphicons-halflings-regular-7206a6a5553d1b106dc988b6af7e29df.ttf 
I, [2014-03-01T01:06:01.994971 #28852] INFO -- : Writing D:/BitNami/rubystack-2.0.0-11/projects/keyandcar/public/assets 
/bootstrap/glyphicons-halflings-regular-a6d95d67a6db3f50ff64b2103e8c9348.woff 

我将此添加到配置/应用.rb无效:

config.assets.initialize_on_precompile = false # for Heroku 

我不知道哪里出现故障,至于它是预编译问题还是PG听5433而不是5432或什么。

感谢您的帮助...... R_G

+0

你的gemfile是什么样的?这可能是这个问题的线索。 – JohnSalzarulo

回答

1

你在你的Gemfile添加rails_12factor创业板规定here

gem 'rails_12factor', group: :production 
+0

你知道吗,我记得昨天晚上看到那个,试图尝试,但是没有......我想我很累。无论哪种方式,推动heroku与此修复工作。该应用程序仍然崩溃,但这是一个不同的问题。谢谢。 –

-1

试试这个:

$ rm Gemfile.lock && bundle 
$ git add Gemfile.lock 
$ git commit -m "Update Gemfile.lock" 
$ git push 
+0

这可能会导致比解决问题更多的问题。 – sevenseacat

+0

@sevenseacat为什么? – Agis

+0

,因为你刚刚说'好吧,忘记你在Gemfile中针对这些特定版本的gem构建了你的应用程序,并确定了一组全新的版本,这些版本可能与您的应用程序兼容或不兼容。 – sevenseacat

相关问题