将 Rails 和 Puma 与子域 lvh.me 一起使用? [英] Using Rails and Puma with subdomains lvh.me?
问题描述
我使用带有子域的 Rails 4,现在从 Unicorn 切换到 Puma.似乎工作正常,但是当我尝试启动rails s"时,我得到:
I'm using Rails 4 with subdomains, and now switched from Unicorn to Puma. Seems to work fine, but when I try to start "rails s" I get:
Rails 4.2.0 application starting in development on http://localhost:3000
我需要运行以下内容
rails s -p 3000 -b lvh.me
获得:
Rails 4.2.0 application starting in development on http://lvh.me:3000
有没有办法让 'rails' 总是自动启动 lvh.me?在切换到 Puma 之前,我曾经这样工作.
Is there a way to make 'rails s' always to start lvh.me automatically? Used to work like that for me before switching to Puma.
推荐答案
Rails 只提供了一种指定绑定主机的方式(通过 -b, --binding 参数).
Rails provide only one way to specify binding host (through -b, --binding argument).
所以,我认为您只有一种简单且适当的方法来解决您的问题.您应该为运行 Rails 创建 bash/sh 别名:
So, I think you have only one simple and appropriate way to resolve your problem. You should create bash/sh alias for running Rails:
alias lvh='rails s -p 3000 -b lvh.me'
这篇关于将 Rails 和 Puma 与子域 lvh.me 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!