Browsing » Ruby on Rails

Running a Single Test File in Rails

There are cases where you don’t want to run your entire Rails test suite. From your Rails application directory run the following command:
ruby -I lib:test test/integration/dealer_admin_test.rb
A small but useful tidbit.

Problems with MySQL Gem and Rake on Snow Leopard

I recently got a new MacBook Pro and had problems creating a new database for my Rails app on Snow Leopard. Running rake db:create left me with the following useless error:
Couldn’t create database for {”username”=>”root”, “adapter”=>”mysql”, “database”=>”delete_me”, “password”=>nil, “socket”=>”/tmp/mysql.sock”}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching [...]

Rails 2.3.2 ActionMailer Views and Multiple Body Instance Variables

While upgrading our Rails app to version 2.3.2 I ran into a painful bug when running our unit tests. Previously, we defined ActionMailer instance variables to be used in our views like this:
@body["name"] = user.name
@body["feedback"] = feedback
@body["when"] = Time.now
I had to refactor this to use a hash as the ActionMailer documentation suggests:
body {:name => user.name, [...]

Git: ’submodule’ is not a git-command

This was the error I received when deploying a Capistrano deployment from github. Keep in mind to even get your submodules deployed you’ll need to add the following var to deploy.rb:
set :git_enable_submodules, 1
It turns out that I had git 1.5.2.5 and submodule support did not come until 1.5.3. So I was forced to upgrade. The [...]

Rails Engines and the “A copy of ApplicationController has been removed from the module tree but is still active!” error

This was a beast of an error to get around, but finally I did in a not so clean manner. I’ve been working with Rails Engines and the approach was to make all controllers in my engine path “unloadable” per the last comment in this thread:
http://dev.rubyonrails.org/ticket/6001
Not the cleanest approach, but it will work until I [...]

Ruby on Rails Console Logging

If you’ve developed in Rails for a decent amount of time then you’ve most likely needed to use the interactive console: ruby script/console. This has saved me within our production application on many occasions. As you probably know, when using the console in production mode, logging is disabled. Sometimes it’s useful to see the queries [...]

Ruby on Rails and Problems with Facebook Rake Task

If you’re new to developing Facebook applications with Rails then here’s a tip for you. You’ll need to install the RFacebook gem for starters: gem install rfacebook. If you read any of the online tutorials you’ll read that you need to run the rake facebook:setup task to create the facebook.yml file. You may end up [...]

Ruby on Rails vs Java - Mac Style

Thought this was a pretty funny/geeky version of the Mac ads based on Rails vs Java. You gotta love what’s in the hibernate jar.

Ruby on Rails vs Java Video

Aptana on Rails

I’m pretending there hasn’t been a two month gap since my last post.  I’ve been caught up with a project called Ublip where we’ve spent a considerable amount of time reinventing ourselves.  Well let me rephrase that and say that we’ve pulled a superstar team together and taking a different approach….more on that later.
This post [...]

Deploying Rails To Unix Using Capistrano

One of my favorite features of Rails is the great Capistrano deployment process.  I’ve been using Capistrano to deploy to Linux servers for several months now and absolutely love it.  Recently I ran into a problem deploying to a Unix server and couldn’t for the life of me figure out what was going on.  It [...]

« Previous Entries