【问题标题】:Unicorn in Heroku? Why not in development?Heroku中的独角兽?为什么不开发呢?
【发布时间】:2014-02-28 05:40:43
【问题描述】:

我刚刚安装了 unicorn gem 并在 config/unicorn.rb 下添加了配置文件

我还添加了一个 Procfile,如下所示:

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

我想知道,为什么我的 localhost 没有在 Unicorn 中运行,即使我添加了这个?哪里说这应该只在生产环境中运行?

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

    如果你没有在GemFile 中加载unicorn gem,Rails 将默认为WebBrick

    我们在开发中使用Thin,这是我们的 GemFile:

    group :development do
        gem 'thin'
    end
    
    group :production do
        gem 'puma'
        gem 'newrelic_rpm'
    end
    

    您也可以从这个问题中受益:Why would I want to use unicorn or thin instead of WEBrick for development purposes?

    【讨论】:

      猜你喜欢
      • 2013-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-19
      • 1970-01-01
      相关资源
      最近更新 更多