I am just finishing a simple app that doesn’t require a database. When running it on the server I was getting errors saying :
LoadError (no such file to load — sqlite3):
But it was already commented out of my Gemfile. It took some thinking before I realized that ActiveRecord is probably looking for that by default regardless of whether or not I am including it in my Gemfile. So the solution was to remove ActiveRecord. That used to be reasonably obvious in Rails 2.3 but Rails 3 made it a little less so. A standard config.application.rb file starts with the lines:
require File.expand_path(‘../boot’, __FILE__)
Rails 3 is broken up into a bunch of different parts and that require ‘rails/all’ pulls in, well all of them including ActiveRecord. An equivalent statement would be:
Of course once you have exchanged ‘rails/all’ for that, you can simply comment out ActiveRecord and that’s that. If you are starting a new Rails app you can have Rails do that for you by using the flags -O or –skip-activerecord.
Now that AR is gone, my app starts without looking for a database and all is goodness and light.