Posted: February 21st, 2011 | Author: Robert Shedd | Filed under: posts | Tags: ruby, ruby on rails | No Comments »
A security update for Ruby has been released to respond to multiple vulnerabilities. All versions of the interpreter are affected, including the Ruby Enterprise Edition interpreters.
Fortunately, it’s easy to upgrade with RVM:
Tell RVM to upgrade your specific REE installation to the latest:
rvm update #upgrade RVM
rvm upgrade ree-1.8.7-2011.02 ree-1.8.7-2010.02 #upgrade REE
Accept Y to all options to move elements of your current install.
Then reset REE to be your default:
rvm --default ree-1.8.7-2011.02
Following this, confirm that the new install of Ruby is active for your shell session (
which ruby). Then, you will likely need to install bundler again to make sure you have 1.0.10 for the upgraded copy of gem 1.5. Also, run bundle install from the app root to make sure your gemset is up to spec.
Despite telling the upgrade process to move everything, I still needed to reinstall Passenger (3.0.2) and reconfigure it for Apache:
gem install passenger
With this reinstallation, you’ll also need to edit your Apache config file (on Mac OS X:
/etc/apache2/httpd.conf ) to point to the new Passenger gem.
Restart Apache from System Preferences > Sharing > Web Sharing and you should be good to go.
Posted: May 26th, 2010 | Author: Robert Shedd | Filed under: posts | Tags: ruby, ruby on rails, tips | No Comments »
After configuring MacPorts, I was running into an issue on my Mac with Ruby on Rails where ‘/usr/bin/env ruby’ was giving me a different version of ruby than the one which has my gems installed. This was an issue for trying to run the ruby scripts with the shebang according to the best practices (i.e. /usr/bin/env ruby). So, trying to run script/console or script/server gave me lots of headaches. This may be a simple fix, but hopefully this will help others with similar issues.
$ /usr/bin/env ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
$ /usr/bin/ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
It took me a bit of fiddling and testing to figure it out, but I finally realized out that the MacPorts installation process had put its bin directories before the default bin directories. Ordering is fairly crucial – paths that are listed first take preference.
This is what I had after installing MacPorts:
This is the correct order (note – moved the /opt/local paths for MacPorts at the end to get things loaded in the right order):
With the order changed, now Ruby and Gem load from the same install (the MacPorts version of Ruby was loading overtop of the base Mac install).
Again, a simple fix, but hopefully, it might help someone running into the same issue.