Testing a Rails Application in IE in Parallels and in Leopard

by Jonathan Longnecker

me being a champWe just wrapped up a kick-awesome web app design and I learned a ton of new stuff, so I’m going to be posting some new tutorials. Most of this can be found elsewhere, but it’s usually in multiple places so I’m trying to consolidate it for you. Aren’t I a champ (see awful picture)?

Yeah anyway, so since I was responsible for the integration of my HTML/CSS/Javascript into an already-in-progress Ruby on Rails application I knew I was going to have to test in multiple browsers outside of my static mock-ups.

Wait, I need to back up a sec. You’ll need to have rails installed and you’re going to have to use the terminal (scary, I know!). Usually what happens is you cd (change directory) in to the folder on your hard drive where the application lives. For me this would be something like:

cd /users/homefolder/sites/application 

Then to start the Rails server:

ruby script/server 

Now that it’s running you go to http://localhost:3000 in your browser and viola! Test that web application.

Of course, if your running IE in Parallels this doesn’t work. It can’t read the 3000 port. You have to open it up. In Tiger, this was a lot easier (and led to much head scratching when I tried it in Leopard), but I finally figured it out. In the terminal, do this:

sudo ipfw add allow tcp from 3000 to 3099 

This will open up ports 3000 to 3099 in your firewall! Astounding! Actually, you can open up however many you want, this is just in case you’re working on 99 rails apps at the same time (I’d peg the Less Everything guys for that).

So now that these ports are open, you can get to the application with your computer’s IP address plus the :3000. So for example, mine would be http://10.0.10.10/:3000 This .is all fine and good, but most people’s IP addresses are assigned by your router and change all the time. Plus, if you ever need to work on the project somewhere else it will change as well.

Edit your local nameEnter your .local address. I use this address for all my web development for this very reason. I keep all my sites in the Sites folder and access them from something like this: http://jon-mbp.local/~homefolder/ You c.an find your short name in your web sharing preferences.

I believe that you have to install Bonjour for Windows first, but once that is done you just use the same address, but take off your user folder name and add the :3000. So http://jon-mbp.local:3000.

Rails app running in IE7 in ParallelsAnd there you have it! Test that rails app in IE to your heart’s content. And I seriously don’t claim to be an expert on this stuff, so if I’m dead wrong about something, let me know.

October 03, 2008

Tutorials

Comments

  1. Thanks for the mention. We have been trying to keep things slowed down and are only doing 37 - 47 projects at anyone time. (Those are our favorite numbers. But not in that order).

    steve

  2. Sweet, I think 47 projects at a time is pretty much the perfect number!

  3. Even the you from 2008 was Kicktastic.  Thanks for this tip, you were #1 on the Google when I needed help on this.

  4. @Ryan BattlesHaha you’re welcome. I’m glad Google remembers because I forgot all about this smile

Behold our Amazing Portfolio

Check it Out