Rails paths leading to a domain with "ude" instead of "localhost",

For some reason, when I test, all my paths and the link lead to the "ude" domain, and not to the regular localhost. Where should I start digging to figure this out?

+5
source share
3 answers

Could you check your /test.rb environments, environments / development and make sure for the url you want:

Rails.application.routes.default_url_options[:host] = 'DESIRED URL' 
+8
source

You can change your domain name using the following command in the 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

Update DNS settings with sudo dscacheutil -flushcache

Now rails server will now work with http: // localhost: 3000 /

You can also change it to whatever you like, for example

add a line to 127.0.0.1 www.rubyrails.com

and update your DNS setup with sudo dscacheutil -flushcache

Now the rails server will run at http://www.rubyrails.com rails server

+4
source

Use helpers urls that end with _path (relative) instead of _url (absolute)

+1
source

Source: https://habr.com/ru/post/1265145/


All Articles