Skip to content

Instantly share code, notes, and snippets.

@jacques
Last active December 11, 2015 22:49
Show Gist options
  • Save jacques/4672368 to your computer and use it in GitHub Desktop.
Save jacques/4672368 to your computer and use it in GitHub Desktop.
Moving over to TextDrive v2 and need to use Ruby 1.8.7 with your ancient Ruby on Rails site? This script is run from your RAILS_ROOT/script directory and fixes the scripts to use the ruby18 binary and gets your pkg_alternatives files in place to use ruby 1.8.7 when using irb / ruby at the command line.
#!/opt/local/bin/bash
#
# Fixes ancient ruby on rails sites to use the ruby18 binary so they use 1.8.7.
#
pkg_alternatives manual ruby18-base
gsed -i'.bak' -e '/env ruby/s/\/usr\/bin\/env ruby/\/opt\/local\/bin\/ruby18/g' about breakpointer console destroy generate plugin runner server process/reaper process/spawner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment