For some reason when I test, all my paths and link lead to a domain of "ude" rather than the usual localhost. Where should I start to dig to figure this out?
Could you check your environments/test.rb, environments/development and make sure the following is set to the URL you want :
Rails.application.routes.default_url_options[:host] = 'DESIRED URL'
You can change your domain name by using the following command in your terminal
sudo nano /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.56.2 qruqsp.local
[ Read 10 lines ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell
change 127.0.0.1 to localhost instead of ude in your case
Refresh DNS settings with sudo dscacheutil -flushcache
Now rails server
will work now with http://localhost:3000/
Also you can change it to anything you like for example
add a line in 127.0.0.1 www.rubyrails.com
and refresh the DNS setting with sudo dscacheutil -flushcache
Now rails server
will run in http://www.rubyrails.com:3000/
Use the url helpers that end in _path (relative) instead of _url (absolute)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With