I finally figured out the problem with both the VPS’d domain and my original Dice Server, without help from DreamHost no less.
This all started when DreamHost moved my domain to a new server 8 days ago. Over those 8 days, my dice service was down due to its inability to load the mysql gem.
Note that my application is a native Ruby application. It is not a Rails app. It is not a Sinatra app. The domain does not use Passenger.
The only response from support over those 8 days was that a new Passenger configuration may have broken the old ways of doing things. This, in spite of my site not using Passenger.
This response from the support team is why I decided to try to use Passenger on a VPS system, but that system didn’t work “out of the box” either.
So, back to debugging the native Ruby application…
Running the Ruby app from an SSH session showed the error. When I updated the code to ‘require “rubygems”’ before requiring mysql, the app worked from the SSH session. It did not work from a browser connection, however.
The difference between the SSH session and the browser connection, in spite of the fact that the app is run as the same user, is that the SSH connection defined the GEM_PATH environment variable. This value specifies the paths that the rubygems library will use to search for gems. When run as the browser, GEM_PATH was not defined and another path was used as a default: /.gems/ruby/1.8
Note that the system-wide gem repository (/usr/lib/ruby/gems/1.8) is not included in the list of search paths, leading to a huge amount of system-wide gems to be left unused.
I somehow doubt that this was the desired result. Because of this restriction to user-installed gems, my Dice Roller failed to run and Passenger failed to run out of the box b/c the rack gem was not found.
To get around this, I used the Gem.use_paths method to hard-code the search path to the system gem path if GEM_PATH was not defined.
After 8 days, my site is back up and running.