INCLUDE_DATA

Entries from April 2009 ↓

starling yaml config file

I had a bit of trouble figuring how this should look like. Ended up finding it here. Basically, it should look something like:


starling:
queue_path: spool/starling
pid_file: pids/starling.pid
log_file: logs/starling.log
daemonize: true

Setting up starling on ubuntu

I use Enterprise Ruby for anything ruby. Here is the no none-sense process:

  1. sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline5-dev
  2. Go here http://www.rubyenterpriseedition.com/download.html. Download and install
  3. On your server: sudo ln -s /opt/ruby-enterprise-x.x.x /opt/ruby
  4. sudo rm /usr/bin/ruby /usr/bin/gem
  5. sudo ln -s /opt/ruby/bin/ruby /usr/bin/ruby
  6. sudo ln -s /opt/ruby/bin/gem /usr/bin/gem
  7. sudo gem sources -a http://gems.github.com
  8. sudo gem install starling-starling
  9. Create a /etc/init.d/starling file and put this: http://gist.github.com/28849 in it
  10. sudo chmod +x /etc/init.d/starling

Done! Enjoy :)

Reloading a model during a migration

It’s documented, but I’ve somehow missed it. I was running this migration:

This kept failing with: undefined method `original_name=’ for #<Unit:0×3b61aa4>

After some poking around, comes reset_column_information to the rescue. After adding the columns and before looping, just add Unit.reset_column_information. This will reload the Unit model with the new columns, and all will go well.