no such file to load — pdfkit (LoadError)

Problem
You are trying to use the pdfkit (here) in your rails application, and you configure it according to the configuration options for the rails 2.x in the config/environment.rb file. Although the application works, when you are trying to use the console you get the error:

no such file to load -- pdfkit (LoadError)

Solution
Make sure that:

require 'pdfkit'
in the config/environment.rb file comes after the line:

require File.join(File.dirname(__FILE__), 'boot')

converting MySQL sysdate to local timezone

Problem
You are hosting your MySQL server in a shared host which is in a different country from your application’s local timezone, and you cannot change the MySQL system timezone, but you would like to use sysdate for date comparisons.

Solution
In your SQL query that you use for comparing with the system date/time, use the convert_tz function in MySQL, using the appropriate local time zone (ie Europe/London):
convert_tz(sysdate(),'SYSTEM','Europe/London')

capistrano deployment fails after dreamhost server move

Problem
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with ‘permission denied’ when trying to get the git repository.

Solution
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.
Follow the details here how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.

NameError: uninitialized constant UserTest::Factory

Problem
You are trying to use shoulda with factory_girl but you are getting the above error:

NameError: uninitialized constant UserTest::Factory

Solution
Insert the following to your config/environments/test.rb
config.gem 'shoulda', :lib => 'shoulda'

install the gem with:
sudo gem install shoulda

add the following to your test/test_helper.rb
require 'factory_girl'
require "factories"

in your test use the new syntax without the underscore, as in:
should belong_to(:model)

Create a rails app in a specific version

Problem
You have installed various versions of rails (ie 3.0, 2.3.8, 2.3.5 etc). You want to create a new rails application for a specific version, and if you run rails app_name, it will create an application in the latest version you have installed.

Solution
Use the following if you want to create a specific rails (ie 2.3.8) application:

rails _2.3.8_ app_name