I am using Arch Linux and installed Ruby (this is version 2.0.0).
When I installed Ruby it said I should add:
$(ruby -rubygems -e "puts Gem.user_dir")/bin
to my path, I added it to .bashrc
When I try to gem install rails or any other gem it gives the Error: Failed to build gem native extension. this is the full error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/lib/ruby/gems/2.0.0 directory.
[alexander@localhost ~]$ sudo gem install rails --no-user-install
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR="
sh: make: command not found
Gem files will remain installed in /usr/lib/ruby/gems/2.0.0/gems/atomic-1.1.10 for inspection.
When I look this error up I see that people solve this error by installing ruby-dev packages, however this does not exist for Arch Linux. Any other option that I can try?
Thanks in advance!
To build native extensions you need the c++-compiler and tools. This is said clearly:
sh: make: command not found
Except of make
utility you obviously need the compiler itself (e. g. gcc
) and company. Thus,
sudo apt-get install gcc
will do the trick. BTW, the properly suggested above RVM-way will definitely require build-tools as well.
try this commands
sudo apt-get install ruby1.9.1-dev build-essential
sudo apt-get install ruby-compass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With