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.
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 [...]
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, [...]
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 [...]
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 [...]
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 [...]
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 [...]
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
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 [...]
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 [...]