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.

Thursday, May 17, 2012

YAML.load Converts Numbers With Leading Zeros Incorrectly

Today, we ran across an issue with YAML.load giving us very unexpected results for some numbers in strings, but not others.


So, it turns out that it assumes numbers with a leading zero to be an octal, and tries to be helpful by converting them for us.  More trial and error lead us to find that single quotes help, but require a little c in some cases.  Here are the results of trying various things.  Notice the different placement of single quotes.



I hope this helps someone out.  If so, let me know!

Wednesday, May 16, 2012

Database file /usr/local/rvm/config/user does not exist

If you've made changes to RVM recently and you start getting the following error when you cd into your app directory or use an rvm (your path may vary):

Database file /usr/local/rvm/config/user does not exist.

Try reloading your bash profile by either running bash or closing and reopening your terminal session. After much digging on Google with no results, this ended up fixing the issue.

Friday, March 9, 2012

No More console.log Errors in IE

Are you really fed up with breaking IE with console.log in javascript?  Add this to the beginning of your JavaScript.  If you're using Ruby on Rails, add it to the beginning of your application.js file.


Code was created during conversation between myself and Slaive. Enjoy!

Tuesday, April 26, 2011

HTML Output With Cucumber

There are times when you want your Cucumber test results available to your team at all times.  To always generate html output by default, simply edit lib/tasks/cucumber.rake to look like this:



You can output to whatever file you would like. We tend to give the team or customers a custom URL that renders that html. On some internal apps, we simply symlink to that file in the public folder when deploying. Either way, you have a pretty friendly way of showing the condition of your cucumber tests. Let me know what you think.