Strange errors when upgrading merb

Wednesday 11/26/2008  –  Category: Merb  –  No Comments

I had some strange errors when upgrading to the latest version of merb (1.1.3).  When trying to run

rake db:automigrate

I would get something like:

~ Connecting to database...
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `initialize': wrong number of arguments (8 for 1) (ArgumentError)
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `normalize_uri'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/abstract_adapter.rb:44:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:159:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `setup'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:44:in `setup_connections'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:27:in `connect'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb_datamapper.rb:17:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:172:in `bootup'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:42:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core.rb:169:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/bin/merb:11
from /opt/local/bin/merb:19:in `load'
from /opt/local/bin/merb:19

After googling for awhile I found this post that suggested downgrading the addressable gem back to 1.0.4.  I tried doing that but stuff was still acting funky, it would say

FATAL: The gem dm-core (= 0.9.7, runtime), [] was not found

even though it was still there.  For some reason, doing sudo gem uninstall merb didn't clean up all the merb+other dependencies, so I had to start of clean by removing merb and all its dependencies:

sudo gem uninstall addressable data_objects datamapper dm-aggregates dm-migrations dm-sweatshop dm-timestamps dm-types dm-validations do_mysql do_sqlite3 merb-action-args merb-assets merb-auth merb-auth-core merb-auth-more merb-auth-slice-password merb-cache merb-core merb-exceptions merb-gen merb-haml merb-helpers merb-mailer merb-more merb-param-protection merb-slices merb_datamapper

After installing one more time, everything worked fine and dandy.  Sheesh, why can 'sudo gem update merb' play nice out of the box?

Using Monit to…monitor stuff

Tuesday 11/25/2008  –  Category: Uncategorized  –  No Comments

Monit is a useful tool that lets you monitor your server and run commands based on certain variables (ex: restart your mongrel instances if they grow > x MB).  Plus, it comes with a nice web interface to quickly see your load averages and memory usage (easier than logging in and running top).

I've liked using Phusion Passenger as a stupid-easy deployment solution for Rails (and now merb) apps, but running three Rails apps and one Merb app on a Slicehost 256slice, things got kind of crowded.  I had to set the PassengerMaxPoolSize variable to 2 in order to keep my free memory at an acceptable level, and I got annoyed when Passenger would automatically kill my apps after a certain amount of idle time or when another app was started up.  Though things were generally zippy once the instances were loaded, there was a laggy startup time while spawning the new app.

Because of this, I decided to take another shot at deploying with mongrel+nginx--I had used it for a site awhile back but had gotten lazy.  It turns out that nginx (a super-fast lightweight web server) is a lot easier and less confusing to setup and configure than Apache...and after setting up the reverse proxy stuff my Rails/Merb apps were humming along smoothly.

Another cool thing about nginx is that it serves static assets (stylesheets/js/images/etc) really fast.  To take advantage of this on my blogs, I installed WP Super Cache (following this howto) to generate static files.  This speeds up load time since Wordpress doesn't have to hit the database at all once a page is cached.

Overall I'm happy with the move to nginx/mongrel...and now my server is running 30% free memory (as compared to just a few MB to spare with my previous setup).

Where does my time go?

Friday 11/21/2008  –  Category: Uncategorized  –  1 Comment

I've been using RescueTime for awhile to track my usage trends and see how (un)productive I am over a certain period of time.  Their web interface is pretty easy to use and it shows pretty graphs (see ma, I really do work!)

But part of me feels kinda weird having an app push updates to a server in YAML:

app_name: Firefox
window_title: 'RescueTime - finally a time tracking app that does not suck | James Robey'
extended_info: 'http%3A%2F%2Fwww.jamesrobey.com%2Frescuetime-finally-a-time-tracking-app-that-does-not-suck%2F'
start_time: 2008-11-21 14:58:56
end_time: 2008-11-21 14:59:06

I just ran into another (standalone) app that looks promising--Slife.  The interface has few different visualization options -- one with the icons of the applications you're using in a timeline view, another that shows total time per application, and another categorized by activity (e.g. "checking email").  If it ends up working well I may ditch RescueTime and keep my usage data local...

Lost?

Thursday 11/20/2008  –  Category: Uncategorized  –  No Comments

Is anyone else seeing this on the top of their Facebook home page?

Please reset your email notification settings.

Unfortunately, your email notification settings have been lost. You can reset them on the Notifications page. We're sorry for the inconvenience.

I'm wondering how Facebook goes about losing things...perhaps someone accidentally dropped a table?  Whoops.

 Page 10 of 13  « First  ... « 8  9  10  11  12 » ...  Last »