Friday, August 24, 2012

The given ruby environment requires system (RVM::IncompatibleRubyError)

Here's another Passenger error I wanted to share. I had a hard time while searching for this error:
Exception PhusionPassenger::UnknownError in PhusionPassenger::ClassicRails::ApplicationSpawner (The given ruby environment requires system (versus ruby-x.x.x-pxxx) (RVM::IncompatibleRubyError))
It took changing my .rvmrc file from this: ...to this: I believe the error occurred as the result of an RVM update, where some necessary changes were already made, but feel free to comment if this doesn't fix the error for you, and I'll sure I can help. UPDATE: here are a few other things to check if you're still getting errors: 1. You may need to setup some load paths. We just added a file under config called setup_load_paths.rb. Notice that we commented out the unshift at some point. 2. Check that the following lines are in your config/deploy.rb. Again, we later commented out a line due to upgrades. As always, please let me know how this works out for you.

A Errno::EEXIST occurred, File Exists

Ran across an error after deploying a rails app to production:

A Errno::EEXIST occurred in home#index:
  File exists - ...
In the stacktrace, I noticed that it was using fileutils trying to mkdir (create a directory) for file caching. Normally this wouldn't matter, except the directory it was attempting to create was a broken symlink to a non-existent directory.

Simple Solution: Manually mkdir the directory that is being symlinked to.

Wednesday, August 15, 2012

no such file to load -- rvm/capistrano

After an upgrade to Ubuntu, resulting in a reinstall of RVM and rebuilding all Gemsets, I ran into the following error trying to deploy with Capistrano:

`require': no such file to load -- rvm/capistrano (LoadError)

The gem was there. After much hair pulling and Googling, I found nothing that worked. After much trial and error, the solution was to uninstall the capistrano and rvm-capistrano gems and reinstall them.