Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my rubgems not making symbolic links to binaries?

I'm on Ubuntu 11.04 with ruby 1.9.2p180 installed from source using rvm. When I install a gem that makes a command-line binary, links are not made. For example, when I install the passenger gem, /var/lib/gems/1.9.2/bin/passenger is installed as expected and works, but a symbolic link is not made from /usr/bin/passenger as expected.

update

actually I have the same problem with vendor ruby and gem (on a different 11.04 server that has never had rvm).

$ sudo gem install bundler
$ bundle
bash: bundle: command not found
$ type bundle
-bash: type: bundle: not found
$ ls -lF /var/lib/gems/1.8/bin/bundle
-rwxr-xr-x 1 root root 383 2011-08-13 19:49 /var/lib/gems/1.8/bin/bundle*
like image 801
John Bachir Avatar asked Dec 13 '22 10:12

John Bachir


2 Answers

RVM installation should be self-contained, which means it won't create symlinks out of the RVM directory. That should not be problem, though, as passenger binary should be added to path automatically by RVM.

Basically it should work like this:

$ rvm use ruby-1.9.2-p290
$ which gem

~/.rvm/rubies/ruby-1.9.2-p290/bin/gem

$ gem install passenger
$ which passenger

~/.rvm/gems/ruby-1.9.2-p290/bin/passenger

I would guess that you are using ubuntu's version of gem and ruby. rvm use ruby-1.9.2-p290 --default should fix that.

If rvm function is not accessible, add this to your .bash_profile:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

See https://rvm.beginrescueend.com/rvm/install/ for details.

like image 85
romario333 Avatar answered Dec 15 '22 00:12

romario333


I guess this can be your problem: installing rvm gems with sudo. Given you have the right privileges in your machine, this is not needed. But if you really need this, do rvmsudo gem install bundler instead.

like image 28
Victor Rodrigues Avatar answered Dec 15 '22 01:12

Victor Rodrigues