在 Mac OS X 下开发时如何在 IE 中进行测试?

发布于 2024-08-17 18:46:18 字数 153 浏览 8 评论 0原文

我已经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

你好,陌生人 2024-08-24 18:46:18

您所需要的只是 VMWare 用于访问您的 Mac 的正确 IP 地址,然后您可以像这样访问它:

http://192.168.1.2:3000

测试一下就好了。我会告诉您如何找到它,但我在 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:

http://192.168.1.2:3000

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 the http:// on as well).

眉黛浅 2024-08-24 18:46:18

VMWare 具有三种不同的网络模式:

  • NAT - 映像在通过主机路由的隔离网络中运行。
  • 桥接 - 映像作为独立设备在与主机相同的网络上运行。
  • 仅主机 - 映像在未路由的隔离网络中运行。

在 NAT 模式下,您需要检查网关 IP 并像使用 localhost 一样使用它。由于这个数字似乎是任意的,但对于任何给定的图像来说都是不变的,因此在 HOSTS 文件中创建一个条目来保存它以供后代使用可能会更方便。

在桥接模式下,您只需使用主机的 IP 地址,而不是特殊的 VMWare 地址。

使用 NAT 是最直接的,因为您只需检查 ROUTE PRINT 的输出并查找默认网关:

Network Destination        Netmask          Gateway       Interface  Metric
      0.0.0.0          0.0.0.0     172.16.153.2  172.16.153.130       10

通常这是第一行,但它是由目标 0.0.0.0 标识的行。

将此条目添加到 XP 上位于 c:\windows\system32\drivers\etc 的主机文件中:

172.16.153.2    localhost.local

然后您可以使用地址 http ://localhost.local:3000/ 而不是任意 IP 地址。如果您使用 Passenger 运行应用程序,则可以为 Passenger 定义的每个条目添加额外的行。

VMWare has three different networking modes:

  • NAT - The image is run in an isolated network that is routed through the host computer.
  • Bridged - The image is run on the same network as the host computer as an independent device.
  • Host Only - The image is run in an isolated network that is not routed.

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:

Network Destination        Netmask          Gateway       Interface  Metric
      0.0.0.0          0.0.0.0     172.16.153.2  172.16.153.130       10

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:

172.16.153.2    localhost.local

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.

耳根太软 2024-08-24 18:46:18

在 Mac 终端中,输入

ifconfig vmnet1

You will get back like:

vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether .... 
    inet 192.168.18.1 netmask 0xffffff00 broadcast 192.168.18.255

You can use the IP returned after "inet" (在本例中为 192.168.18.1) 来连接到您的应用程序,例如

http://192.168.18.1:3000

与给出的其他答案相反,使用网关地址Windows 客户端对我有用,这是不同的。

In your Macs Terminal, type

ifconfig vmnet1

You will get back something like:

vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether .... 
    inet 192.168.18.1 netmask 0xffffff00 broadcast 192.168.18.255

You can use the IP returned after "inet" (192.168.18.1 in this case) to connect to your app like e.g

http://192.168.18.1:3000

As opposed to the other answers given, using the gateway address of the Windows client does not work for me, it is different.

小女人ら 2024-08-24 18:46:18

您无法在 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!

深者入戏 2024-08-24 18:46:18

通过在 VMware 的命令提示符中键入 ipconfig 查找 Windows 正在使用的 IP 地址(您要查找的数字标记为 IP 地址)。然后将最后一个数字替换为 1 或 2。

例如,如果 Windows 在 VMware 中使用的 IP 地址是 192.168.78.0,那么您的 Rails 应用程序将在以下位置可用:

http://192.168.78.1:3000/

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:

http://192.168.78.1:3000/
不必在意 2024-08-24 18:46:18

当然也可以通过网络应用程序检查是否有效渲染 - 请参阅:

  1. http://browsershots.org(免费!)
  2. http://www.browsercam.com/ (他们有演示)
  3. http://litmusapp.com/(付费)

there is of course also the possibility to check for valid rendering via webapplications - see:

  1. http://browsershots.org (free!)
  2. http://www.browsercam.com/ (they have a demo)
  3. http://litmusapp.com/ (paid)
就是爱搞怪 2024-08-24 18:46:18

我不知道这是否适用于所有网络模式,但我这样做了,并且它第一次在默认 vmware 安装上对我有效。

  • 打开命令提示符窗口
  • 运行> ipconfig
  • 读取默认网关 IP 地址 = wxyz
  • 打开 IE
  • 输入 http:://wxyz:3000 作为 URL

这有效,但后来我使用了 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.

  • Open a command prompt window
  • run > ipconfig
  • read the Default Gateway IP Address = w.x.y.z
  • Open IE
  • enter http:://w.x.y.z:3000 as the URL

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文