0

我有炼油厂的应用程序,在本地很棒。 在Heroku上创建了一个竹栈。推送到Heroku时出现炼油厂错误

当我试图把我能看到这一点:

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? 

然后我在浏览器中打开它: “很抱歉,但出事了。”

$ Heroku的日志

Rendered vendor/bundle/ruby/1.9.1/gems/refinerycms-authentication-2.0.2/app/views/refinery/users/new.html.erb within refinery/layouts/login (82.3ms) 
2012-03-15T14:43:25+00:00 app[web.1]: Completed 500 Internal Server Error in 1269ms 

全输出为here

任何帮助是巨大的,谢谢!

+++

更新:

更新堆栈雪松和红宝石制成ENV 1.9.3

$ heroku config 
DATABASE_URL  => .. 
GEM_PATH   => vendor/bundle/ruby/1.9.1 
LANG    => en_US.UTF-8 
PATH    => bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin 
RACK_ENV   => production 
RAILS_ENV   => production 
RUBY_VERSION  => ruby-1.9.3-p0 
SHARED_DATABASE_URL => .. 

$ heroku info --app mimacohuoncedar 
=== mimacohuoncedar 
Addons:  Basic Logging, Shared Database 5MB 
Database Size: (empty) 
Git URL:  [email protected]:mimacohuoncedar.git 
Owner:   .. 
Repo Size:  9M 
Slug Size:  19M 
Stack:   cedar 
Web URL:  http://mimacohuoncedar.herokuapp.com/ 

$ Heroku的日志现在显示这一点: this-updated

在哪里继续?谢谢

回答

2

不知道你是否设法解决这个问题,但我遇到了同样的问题,使用雪松堆栈。在Heroku上发现了这个article,似乎对我有用。在终端线路上,它第一次推。

+0

感谢您的帮助,终于得到了!分享,因为也许其他人会有同样的问题:有3个问题:首先我需要Cedar和_not_ Bamboo堆栈。然后我用“heroku run rake db:migrate”迁移了数据库。最后我用了你提到的文章。非常感谢,它现在起作用! – YogiZoli 2012-04-02 21:52:15

2

我看到了这个相同的错误,并且接受的答案没有为我解决;

This blog然而,伎俩。博客标题是指Rails 3.2,但我在3.1上,并且看到了同样的错误。

博客推荐将此行加入application.rb

config.assets.initialize_on_precompile = false

的意义,从文章总结;

此选项可防止在执行assets:precompile任务时加载Rails环境。由于Heroku在设置数据库配置之前预先编译了资产,因此您需要将此配置设置为false,否则Rails应用程序将尝试连接到一个不存在的数据库。

添加行并推送,现在一切似乎都很好。