开发者

How can I configure gem install to use "install" from the right place?

开发者 https://www.devze.com 2023-04-10 06:36 出处:网络
When I try to install rails using gem on my Arch Linux machine, I get the following error: $ gem install rails

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

$ gem install rails

...

...

make install

/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 located at /bin/install. So on my system I have:

$which install

/bin/install

$

Since I hav开发者_StackOverflowe root access (it is my laptop!), I could easily "fix" this by creating a symlink at /usr/bin/install , but how would I do this otherwise?

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

I am asking this in case I am in a situation where I face the same problem and I don't have permissions to create symlinks in arbitrary places.


Find rbconfig.rb file in your ruby installation dir (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

In that file change line

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

to

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

(Or whichever is the correct install path, I've had to change it back to /usr/bin, for example)

You might want to update other paths as well.

Or, you can just reinstall ruby.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号