I use rbenv to manage ruby versions.

I want to install gvim on my ArchLinux and one of it's dependency is ruby.

I'm already use rbenv to install the version 2.0.0-p247 of ruby as root user and set rbenv global 2.0.0-p247,but when I try sudo pacman -S gvim, pacman still install the package ruby-2.0.0_p247-1.

How can I let pacman notice the ruby installed by rbenv ?


You cannot. However, you can trick pacman into thinking you have (there are two ways to do this).

  1. Simply pass the --dbonly option:

    pacman -S --dbonly ruby

    This will commit the transaction to the database (make a record of the install), but not actually download or install any packages.

    If you want, you could also pass --asdeps to mark it as a dependency.

    Also to note: ruby may get installed for real on upgrade. I'm not sure. You may want to consider locking the version (it's ok because it's not really installed or critical, but normally you should not do this).

  2. Make rbenv provide ruby. You can do this by putting the following line in the rbenv PKGBUILD:


    After doing this, run makepkg again and reinstall the package with pacman -U foobar.pkg.tar.xz.

    You may have to mess with the version of this. See the wiki page on PKGBUILDS.

  • Can rvm be used here as well, or not? I know you can install it as the system level ruby. – slm Sep 15 '13 at 18:27
  • @slm looks like rvm is neither in the official repos nor the AUR. you can use it, though, if you're ok with no package manager integration. – strugee Sep 15 '13 at 19:12
  • 1
    Yeah rvm isn't ever in any packages, it's a shell script, so it's typically not distributed that way to my knowledge. Just wondering on archLinux if that was an apt way to go. – slm Sep 15 '13 at 19:14
  • the only difference is that if you use rbenv you can use method two (that i just added), because there's a package for it, but if you use rvm you can only do method 1. – strugee Sep 15 '13 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.