After saving the /etc/hosts file, run the rails application as shown
rails s -p 3000 -b daycare.no
In browser
http:
Personally, I use lvh.me:3000 only to run rails s -p 3000 -b lvh.me no need to touch the /etc/hosts .
By default, you cannot view the lvh.me:3000 link without an Internet connection, the solution is to add 127.0.0.1 lvh.me to the host file.
# /etc/hosts file 127.0.0.1 localhost 127.0.0.1 lvh.me
But, its a little annoying to run this every time the server restarts.
Ask your command:
sudo nano .bash_profile # OR sudo nano .bashrc # OR sudo nano .profile
AND ADD these lines:
alias lvh='rails s -p 3000 -b lvh.me' alias lvh_production='RAILS_ENV=production rails s -p 3000 -b lvh.me'
Do not forget to restart the terminal tab, close and open a new tab. OR run this command on the same tab . ~/.bash_profile . ~/.bash_profile , depends on what you used on top.
An alternative solution is to use a POW ( LINK ) server to provide you with a custom smth domain, such as daycare.dev .
7urkm3n Apr 09 '16 at 20:37 2016-04-09 20:37
source share