How to configure gem install to use "install" in the right place?

When I try to install rails using gem on my Arch Linux machine, I get the following error:

$ gem install rails

...

...

make installation

/ usr / bin / install -c -m 0755 bcrypt_ext.so/home/gphilip/.rvm/gems/ruby-1.9.3-preview1/gems/bcrypt-ruby-3.0.1/lib

make: / usr / bin / install: command not found

make: * [/home/gphilip/.rvm/gems/ruby-1.9.3-preview1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.so] Error 127

It turns out that on Arch Linux the โ€œinstallโ€ binary is in / bin / install . Therefore, in my system, I:

$ which sets

/ bin / install

$

Since I have root access (this is my laptop!), I could easily fix this by creating a symlink in / usr / bin / install, but how would I do it differently?

How to configure gem to use the "install" command from / bin / instead of insisting on using in / usr / bin /?

I ask for this in case I encounter the same problem, and I do not have rights to create symbolic links in arbitrary places.

+4
source share
1 answer

Locate the rbconfig.rb file in the ruby โ€‹โ€‹installation directory (example for my machine):

 $ which ruby /home/valentin/.rvm/rubies/ruby-1.8.7-p352/bin/ruby $ find /home/valentin/.rvm/rubies/ruby-1.8.7-p352 -name rbconfig.rb /home/valentin/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/x86_64-linux/rbconfig.rb 

This line changes the file

 CONFIG["INSTALL"] = '/usr/bin/install -c' 

to

 CONFIG["INSTALL"] = '/bin/install -c' 

(Or, the correct installation path, I had to change it back to /usr/bin , for example)

You might also want to update other paths.

Or you can just reinstall ruby.

+2
source

All Articles