Thoughtlets, Music, and Code from Noah Thorp

Installing vim with ruby or --enable-rubyinterp on OS X 10.5.2

May 27th 2008

The problem: When installing vim from source with —enable-rubyinterp option you are receiving numerous unsolvable errors (such as ncurses cannot be found when it is installed and you are directing ./configure to it using —with-tlib ncurses). Or, you are trying to install vim ruby using MacPorts and you are getting similar errors.

The solution: install vim using MacPorts and install Ruby first.

sudo port install ruby
sudo port install vim  ruby  huge

Newly installed version is in /opt/local/var/macports/software/vim/7.1.270_0 huge ruby/opt/local/bin

After launching this version of vim it responds to:

:ruby puts "hello world!"

If you have the following in your .bash_profile or .profile file and you reopen your terminal, the newly installed MacPort will take precedence over the default OS X install of vim:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Note that having your MacPort ruby install take precedence over your default ruby installation can modify your environment. Particularly, it may cause ruby to look for a different gem library. You can verify you are using the correct configuration by checking your gem path, version, and gems that you have installed:

which gem
gem -v
gem list --local

If your MacPorts gem version is taking precedence over other gem libraries that you would prefer to use, you can modify the file name or remove the version of the gem that you do not want to use. It is likely that MacPorts is referencing /opt/local/bin/gem and you would like it to reference /usr/bin/gem.