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

ruby-on-rails – Heroku中的独角兽?为什么不在开发中?

发布时间:2020-12-17 02:06:01 所属栏目:百科 来源:网络整理
导读:我刚刚安装了unicorn gem并在config / unicorn.rb下添加了配置文件 我还添加了一个如下所示的Procfile: web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb 我想知道,为什么我的localhost没有在Unicorn中运行,即使我已经添加了这个?在哪里说它应该
我刚刚安装了unicorn gem并在config / unicorn.rb下添加了配置文件

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

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

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

解决方法

如果你没有在你的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?

(编辑:李大同)

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

    推荐文章
      热点阅读