Using Rails and Puma with subdomains lvh.me?

徘徊边缘 提交于 2019-11-30 13:00:19

问题


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

I need to run the following

rails s -p 3000 -b lvh.me

to get:

Rails 4.2.0 application starting in development on http://lvh.me:3000

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.


回答1:


Rails provide only one way to specify binding host (through -b, --binding argument).

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'


来源:https://stackoverflow.com/questions/28741287/using-rails-and-puma-with-subdomains-lvh-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!