Is there any way to conveniently access port 3000 on my Mac from within Windows?
This should be pretty straight forward (for non-subdomained Rails apps). It definitely gets more complicated with subdomains.
From your Mac terminal:
ifconfig -a
Copy the assigned IP address (e.g., 192.168.1.100)
Switch to Parallels, open IE and enter the IP address in the address bar. Don't forget to add the protocol and port number of the running Rails app. For example:
http://192.168.1.100:3000
Voilà! Rails app.
You should probably already be using something like lvh.me
to ease the burden of creating subdomained applications locally (see ASCIICasts 221: Subdomains in Rails 3). It doesn't seem to be so straight-forward on Windows though.
Edit the Windows hosts
file. It should be located somewhere like C:\WINDOWS\system32\drivers\etc\hosts
Assuming your IP address is the same as above, add a line that looks similar to this, and save:
192.168.1.100 lvh.me sub1.lvh.me sub2.lvh.me ... subN.lvh.me
Where sub1, sub2, ..., subN are the subdomains that you want to access from IE.
You should now be able to access http://sub1.lvh.me:3000
from IE.
I was getting pretty tired of looking up my DHCP allocated IP address every time, so I created a new Network location in OS X called Home that uses DHCP with a manually assigned IP address. That way, I can at least save some time when I'm working from home. Just remember to switch locations when you join a different network. YMMV :)
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