SproutCore and Cappucino on Windows
I’ve been wanting to play with a web framework for building a desktop application. Heard good things about SproutCore so I set out to install it, but ran into a number of roadblocks that made it difficult to do on Windows.
The one that made me give up was trying to install the Ruby sproutcore gem. Installing this requires eventmachine, which includes native code. I installed the Ruby DevKit which includes GCC for building the native code, but it produces an error compiling parts of eventmachine.
Most of the cool new web development these days is done on the Mac. With good reason, of course, but I happen to be sitting in front of the computer I use for gaming. It has a nice monitor (whereas my laptop has the laptop monitor), but it runs Windows. This stuff is theoretically all portable so getting it to work should be possible, but I guess that so few people do it that the installers and documentation tend to lapse.
So on to Cappucino.
SproutCore has a build step which requires Ruby, but Cappucino claims that you can just unzip it and invoke index.html and you’re good. But Chrome won’t have that; it doesn’t allow requests to other domains from pages loaded from file:// URLs.
To fix this, you’ll need to serve the files through a web server, like IIS. To install IIS on Windows 7:
- Open the Control Panel
- Select Programs
- Select Turn Windows Features On and Off
- Select Internet Information Services, hit OK
This will install a basic IIS. The default website is in c:\inetpub\wwwroot so grab the Cappucino Starter application and drop it in that folder. (You’ll probably need to enter some administrator credentials along the way).
So now your Cappucino site is accessible at http://localhost/Starter/index.html but it still won’t work, because IIS won’t serve files whose MIME type it doesn’t recognize. So head for the IIS control panel:
- Open the Control Panel
- Select System and Security
- Select Administrative Tools
- Select Internet Information Services (IIS) Manager.
- Select MIME Types.
To add a new MIME type, click the “Add†link at the right. Add 3 new MIME types: .j, .sj, and .plist.
Now you should be able to load your Cappucino app!