Creating acts_as_… gems for Rails 3.1.x

There are a lot of posts on how to build rubygems. With Rails 3.1, though, they’re all old and busted.

The new hotness is built right into rails now. Just incant

rails plugin new APP_PATH

You’ll get:

  • a .gemspec and Gemfile to get started
  • a dummy rails app to integration test your new gem against
  • a (deprecated) RDoc rake task

When you run rake, you’ll see “rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)”. To remedy, follow these steps.

The Edge edition of the Ruby on Rails Guides has more information.

Installing Phusion Passenger on Ruby 1.9.1, Nginx, & Ubuntu 10.04

I wrote this a while back, before I knew about RVM. The Ruby Version Manager has a bunch of features that makes it better than macports for ruby and gem installation. Read about it here.

Getting ruby 1.9.1 and nginx and passenger and ubuntu to all play nicely is fairly straightforward, but it’s not just “apt-get” and “gem install” lovin’.

Making ruby 1.9.1 the default ruby is OK. Follow these steps:

Continue reading