简体   繁体   English

无法从VMware Fusion Guest访问Mac主机上的Rails应用

[英]Can’t access rails app on Mac host from VMware Fusion Guest

I'm probably doing something stupid here, but.... 我可能在这里做些蠢事,但是....

I can't access a rails app running on my Mac from a Windows 10 VM. 我无法从Windows 10 VM访问在Mac上运行的Rails应用程序。 I have set the network adapter to "Share with My Mac". 我已将网络适配器设置为“与我的Mac共享”。 I can access a PHP site running on my mac via http://[my-machine-name].local or http://[my-ip-address] . 我可以通过http:// [my-machine-name] .localhttp:// [my-ip-address]访问Mac上运行的PHP站点。 But if I specify port 3000 to view my rails app I get an error message (to the effect that [my-ip-address] refused to connect) even though the app is running. 但是,如果我指定端口3000查看我的Rails应用程序,即使该应用程序正在运行,我也会收到一条错误消息(表示[my-ip-address]拒绝连接)。 I don't know if this is an issue at the Mac end (though my firewall is off for testing), the windows end, or to do with my VMWare network adapter setting. 我不知道这是Mac端(尽管我的防火墙已关闭以进行测试),Windows端还是与我的VMWare网络适配器设置有关的问题。 Any assistance gratefully received 感谢收到的任何协助

Peter 彼得

只需在运行Rails应用程序(例如rails server -b 0.0.0.0:3000时使用-b标志,即可将其绑定到整个网络接口,并且可以从外部进行访问

I encountered this problem just now. 我刚才遇到了这个问题。 I could not get it to work with -b 0.0.0.0. 我无法使其与-b 0.0.0.0一起使用。

I set it to my hosts local ip "rails server -b 192.168.1.10". 我将其设置为我的主机本地IP“ rails server -b 192.168.1.10”。 I was then able to access the host through my VM's browser http://192.168.1.10:3000/ . 然后,我可以通过VM的浏览器http://192.168.1.10:3000/访问主机。 My VM network is set to NAT. 我的VM网络设置为NAT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从VMWare Fusion VM访问在Pow上运行的应用程序吗? - Can I access an application running on Pow from a VMWare Fusion VM? Rails:如何从virtualbox guest虚拟机(ubuntu)访问主机(windows)上的数据库? - Rails: How can I access my database on my host machine (windows) from a virtualbox guest (ubuntu)? 使用 VirtualBox 从来宾访问主机上的站点? 主机和来宾是 linux - Use VirtualBox to access site on host from guest? the host and guest is linux 尝试从 VMWare Fusion Windows 10 访问 rails 服务器时如何修复“无法渲染控制台”? - How do I fix 'cannot render console' when trying to access a rails server from VMWare Fusion Windows 10? 如何将我的Rails应用程序从Ubuntu Guest到Windows 8.1主机连接到SQL Server? - How to connect my Rails App to SQL Server from Ubuntu Guest to Windows 8.1 Host? 有人可以指出为什么我无法从主机连接到来宾的PGSQL吗? (流浪汉) - Can someone point out why I can't connect to PGSQL on guest from host? (vagrant) 无法从Rails中的URL访问URL我的应用程序 - Can't access my app from url in ruby on rails 无法从主机访问Docker容器 - Can't access docker containers from host 如何从主机访问来宾端口3000? - How to access Guest's port 3000 from Host? 在 Rails 应用程序中拒绝访客访问 - Reject guest access in a rails application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM