【问题标题】:Refinery error when pushing to Heroku推送到 Heroku 时出现炼油厂错误
【发布时间】:2012-03-15 14:56:34
【问题描述】:

我有一个炼油厂应用,在本地运行良好。 在 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

任何帮助都很好,谢谢!

+++

更新:

将堆栈更新为 Cedar 并制作 Ruby 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:       git@heroku.com:mimacohuoncedar.git
Owner:         ..
Repo Size:     9M
Slug Size:     19M
Stack:         cedar
Web URL:       http://mimacohuoncedar.herokuapp.com/

$ heroku 日志现在显示: this-updated

去哪里?谢谢

【问题讨论】:

    标签: ruby-on-rails-3 heroku ruby-on-rails-3.2 refinerycms bamboo


    【解决方案1】:

    不知道您是否设法解决了这个问题,但我在使用 Cedar 堆栈时遇到了同样的问题。在 Heroku 上找到了这个 article,这似乎对我有用。在终端运行线路,它是第一次推送。

    【讨论】:

    • 感谢帮助,终于明白了!分享,因为也许其他人也会有同样的问题:有 3 个问题:首先我需要 Cedar 和 not Bamboo stack。然后我用“heroku run rake db:migrate”迁移了数据库。最后我使用了你提到的文章。非常感谢,现在可以使用了!
    【解决方案2】:

    我看到同样的错误,接受的答案并没有为我解决;

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

    博客建议将此行添加到application.rb

    config.assets.initialize_on_precompile = false

    从文章中总结的含义;

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

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

    【讨论】:

      【解决方案3】:

      那个输出看起来很像 Cedar 堆栈而不是 Bamboo - 试试 http://devcenter.heroku.com/articles/labs-user-env-compile。那应该可以解决您的问题。

      【讨论】:

      • 非常感谢!前面很多!但还是有问题,更新了问题+输出。
      猜你喜欢
      • 2011-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多