Making today worse so tomorrow seems better.
The Blarg is Back!
Now that Merb is going to be Rails, we figured that we would overhaul the old blarg and bring it back to the Rails world. But to keep things interesting, we decided to go all Ruby 1.9.
We also moved the code over to GitHub while we were at it. So if you want to see what we’ve been up to, head over to http://github.com/gnarg/blarg and have a look.
(Note that the RSS feed is still broken, but that will hopefully be working again shortly.)
The Details
The backend is still CouchDB, so we didn’t have to sweat out the mysteries of Ruby 1.9 versus the MySQL adapter. In fact we pulled out ActiveRecord entirely, who says Rails is monolithic?
We are using Thin for the web server, which seems to be working great under 1.9. Mongrel had compilation issues, and we didn’t want to try moving our entire Passenger setup to 1.9.
We use the RedCloth, hpricot, json, and dm-validations gems and none of those gave us any trouble under 1.9.
Michael has been working hard on beefing up our CouchDB interface with DataMapper. With luck we should get a post from him shortly on that topic.
The Stack Today
- Apache 2.2 with mod_proxy_balance
- Thin 1.2.2
- Rails 2.3.2
- Ruby 1.9.1-p129 (on x86_64 Linux)
and
- CouchDB 0.9.0
- Erlang (BEAM) 5.6.3 (also 64-bit)
Notes from Installing and using Ruby 1.9
We installed 1.9 from source and put it in /opt/ruby-1.9 to avoid trying to upgrade the vendor ruby packages. We also used the --program-suffix=19 option so that all our binaries have names like ‘ruby19’ and ‘gem19’, this makes it a lot easier to tell which ruby you are running something under. It did mean adding /opt/ruby-1.9/bin/ to the PATH.
Most Rails commands work the way you would expect:
rake19 gemsto show Ruby 1.9’s view of the gems that your app needsruby19 ./script/serverto fire up a development server.
However script/console calls irb underneath, so it needs a special argument. Otherwise script/console will still be running under Ruby 1.8, which will be highly confusing.
ruby19 ./script/console --irb=irb19
Because we installed Thin with gem19, it is automatically setup to use the Ruby 1.9 interpreter. To check, look at the first line of your thin script ( /opt/ruby-1.9/bin/thin in our case ). The first line should be #!/opt/ruby-1.9/bin/ruby19 and not #!/usr/bin/ruby or #!/bin/env ruby.
- About
- Technology, programming, the interwebs and other topics by members of the slackworks community.
- Contributors
- All Posts
-
- Aug 05 2009 Using New Relic add_method_tracer with Class methods
- Jun 30 2009 Estimating Key Collisions (Birthday Problem)
- Jun 29 2009 The Blarg is Back!
- Jul 23 2008 JNDI with Rails
- Jul 06 2008 JRuby Service in Rails
- May 16 2008 Wildcard DNS and Rails
- Jan 30 2008 Sprint Error "911" and the "Download Domain"
- Jan 16 2008 Getting a Good View of Your Couch
- Jan 12 2008 Bring Selenium to the integration party
- Jan 12 2008 Bj Makes Attachment_fu Happy
- Jan 03 2008 Restore Finder magic to a sparsebundle directory
- Dec 18 2007 First Post
0 comments