在 Mac OS X 下开发时如何在 IE 中进行测试?
我已经在 Mac OS X 上安装了 Web 应用程序,并且已准备好进行 IE 兼容性测试。我尝试过运行服务器、启动 VMware 并拉出 localhost:3000 ,但没有成功。
如何在 IE6-8 和 Chrome 上测试我的 Web 应用程序而不将其部署到某个地方?
I've got my web application on Mac OS X and it's ready for IE compatibility testing. I've tried running the server, booting up VMware and pulling up localhost:3000
with no luck.
How can I test my web application on IE6-8 and Chrome without deploying it somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您所需要的只是 VMWare 用于访问您的 Mac 的正确 IP 地址,然后您可以像这样访问它:
测试一下就好了。我会告诉您如何找到它,但我在 Parallels 方面有更多经验。
编辑 好吧,看来您需要在来宾操作系统 (Windows) 中打开网络连接信息并获取“网关”地址,该地址应该是 VMWare 用于连接到您的 Mac 的 IP 地址。只需将
:3000
添加到其末尾,您就应该能够从 Internet Explorer 访问您的 Rails 站点(请务必同时添加http://
) 。All you need is the correct IP address that VMWare uses to access your mac, then you can access it like this:
And test it just fine. I would tell you how to find it but I have more experience with Parallels.
EDIT Ok, it seems you need to open your network connection information in the guest operating system (Windows) and grab the "Gateway" address which should be the IP address that VMWare is using to connect to your Mac. Simply add
:3000
to the end of it and you should be able to access your Rails site from Internet Explorer (be sure to put thehttp://
on as well).VMWare 具有三种不同的网络模式:
在 NAT 模式下,您需要检查网关 IP 并像使用 localhost 一样使用它。由于这个数字似乎是任意的,但对于任何给定的图像来说都是不变的,因此在 HOSTS 文件中创建一个条目来保存它以供后代使用可能会更方便。
在桥接模式下,您只需使用主机的 IP 地址,而不是特殊的 VMWare 地址。
使用 NAT 是最直接的,因为您只需检查 ROUTE PRINT 的输出并查找默认网关:
通常这是第一行,但它是由目标 0.0.0.0 标识的行。
将此条目添加到 XP 上位于 c:\windows\system32\drivers\etc 的主机文件中:
然后您可以使用地址 http ://localhost.local:3000/ 而不是任意 IP 地址。如果您使用 Passenger 运行应用程序,则可以为 Passenger 定义的每个条目添加额外的行。
VMWare has three different networking modes:
In NAT mode you need to check the gateway IP and use that as you would localhost. Since this number appears to be arbitrary, yet unchanging for any given image, it may be more convenient to make an entry in your HOSTS file to save it for posterity.
In bridged mode, you simply use the IP address of the host machine, not the special VMWare one.
Using NAT is the most straightforward, as you simply have to check the output of ROUTE PRINT and look for the default gateway:
Usually this is the first line, but it is the one identified by destination 0.0.0.0.
Add this entry to your hosts file at c:\windows\system32\drivers\etc on XP:
Then you can use the address http://localhost.local:3000/ instead of the arbitrary IP address. If you're using Passenger to run your applications, you can add additional lines for each entry defined by Passenger.
在 Mac 终端中,输入
You will get back like:
You can use the IP returned after "inet" (在本例中为 192.168.18.1) 来连接到您的应用程序,例如
与给出的其他答案相反,使用网关地址Windows 客户端不对我有用,这是不同的。
In your Macs Terminal, type
You will get back something like:
You can use the IP returned after "inet" (192.168.18.1 in this case) to connect to your app like e.g
As opposed to the other answers given, using the gateway address of the Windows client does not work for me, it is different.
您无法在 VmWare 中使用 localhost(除非 Rails 应用程序在 VmWare 映像内运行)。您需要主机的 IP 地址或主机名,在本例中为 Mac!
You can't use localhost from within VmWare (unless the rails app is running inside the VmWare image). You need the ip address or hostname of the host machine, the mac in this case!
通过在 VMware 的命令提示符中键入
ipconfig
查找 Windows 正在使用的 IP 地址(您要查找的数字标记为 IP 地址)。然后将最后一个数字替换为 1 或 2。例如,如果 Windows 在 VMware 中使用的 IP 地址是
192.168.78.0
,那么您的 Rails 应用程序将在以下位置可用:Find the IP address that Windows is using by typing
ipconfig
from within a Command Prompt in VMware (the number you're looking for is labelled IP Address). Then replace the last number with a 1 or a 2.For example, if the IP address that Windows is using within VMware is
192.168.78.0
then your Rails application will be available at:当然也可以通过网络应用程序检查是否有效渲染 - 请参阅:
there is of course also the possibility to check for valid rendering via webapplications - see:
我不知道这是否适用于所有网络模式,但我这样做了,并且它第一次在默认 vmware 安装上对我有效。
这有效,但后来我使用了 tadman 的答案提到的技术将 IP 地址添加到
c:\windows\system32\drivers\etc\hosts...
wxyz maclocal
将我的主机命名为“maclocal”...我随机选择了这个名称。
访问服务器
然后使用http://maclocal:3000
I don't know if this will work for all the networking modes but I did this and it worked first time for me on default vmware installation.
This worked but then I used the technique mentioned by tadman's answer to add the IP address to the
c:\windows\system32\drivers\etc\hosts...
w.x.y.z maclocal
naming my host "maclocal"....I picked this name at random.
Then accessed the server using
http://maclocal:3000