Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method BDPRSS2::tag() should not be called statically in /home/ericwagoner/ericwagoner.com/weblog/wp-includes/functions.php on line 1303

4/20/2007

Exploring Joyent Slingshot

Filed under:Ruby On Rails, Joyent Slingshot — eric @ 3:09 pm

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ericwagoner/ericwagoner.com/weblog/wp-includes/functions-formatting.php on line 76

Last Friday, I received the Slingshot SDK (Software Developer Kit). About an hour later, I had a copy of my Rails application running in an off-line, fully self-contained environment.

Of course, that was only the beginning, but it did right away show that you could use Slingshot to quickly deploy stand alone Rails applications. Slingshot provides the database (sqlite), the browser (Webkit in OS X and IE7’s engine in Windows), and the server, all in one application window. All you need to supply is the code. No one had talked about that use of Slingshot on the weblogs and forums (that I saw), but it was the first thing that came to mind when I saw it face to face.

My application was not ready for data synchronization. First, I hadn’t upgraded it to Rails 1.2 yet (it was frozen to a slightly pre-1.2 edge release). Second, all of the models to be synched need to have created_at and updated_at data — mine did not. Third, my live app is currently sitting on a shared TextDrive server, and a shared server is not the place to be playing with something like this.

Joyent is helping me with the third problem by providing me with a small accelerator for the duration of the pre-release testing period. An email mix-up on my part kept me from accessing the accelerator until late Wednesday. Yesterday, I logged in for the first time and found myself sitting at the business end of a console prompt in Solaris for the first time in 15 years or so.

I’ve been a shared host sort of guy since I’ve been on the internet, just before the World Wide Web was invented. Having my own server computer, getting it up and running from scratch, has not been something I’ve ever done. Still, by this morning, I had everything installed, Apache was proxying to four Mongrel instances, and a scratch copy of my Rails app was being served smokin’ fast. The documentation to get all this going is still spotty (accelerators are still a new offering, and the early adopters tend to already know what they’re doing), but I was able to piece enough together to get off the ground.

I’ve already frozen my application to Rails 1.2, so that step is out of the way. Now, I have to add created_at and updated_at columns to all my tables, and at that point I can begin adding code to support extraction for offline use and full data synchronization. I’m still not sure what that’s going to entail (I’ve been reading all about accelerators instead of Slingshot these last few days).