简体   繁体   中英

vim 7.3 compiled with ruby 1.8 while running in rvm with ruby 1.9.2

I am running my rails 3 project under ruby 1.9.2 with rvm. I use vim through zsh which was compiled using ruby 1.8 (the system ruby that comes with mac osx).

What's the best way to get these two ruby versions to match up?

Option 1: I can have rvm use ruby 1.8 but I don't want to be "stuck" on 1.8. Plus my 'bundle exec rails' commands don't seem to work with this option.

Option 2: Compile vim with ruby 1.9.2. But will this work ok?

I know using macvim compiled with 1.9.2 is an option but I really prefer the terminal vim.

You would try one of these:

  1. You can use MacVim in Terminal. Just alias vim='mvim -v' if you already have mvim in your $PATH . I use this method personally, and I think it's the easiest way.

  2. Compile vim yourself, with --with-ruby-command=[PATH TO YOUR RUBY 1.9.2] configuration option. I have not tried it on Mac OS; However in Ubuntu Linux I did --with-ruby-command=/usr/bin/ruby1.9.2 and it worked.

FYI: In Ubuntu they keep every program with version number separated and use update-alternatives to switch the default. The /usr/bin/ruby is just a symlink to the default one.

Rather than recompile vim, the easier solution is to change the /usr/bin/ruby symlink to point to your desired version of ruby. I use RVM / mac OSX leopard, and this worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM