Gem install: ERROR: Failed to create native gem extension

I am using Arch Linux and installed Ruby (this is version 2.0.0).

When I installed Ruby, I said that I should add:

$(ruby -rubygems -e "puts Gem.user_dir")/bin 

to my path, I added it to .bashrc

When I try to install gem rails or any other stone, it gives an error: it was not possible to create my own gem extension. this is a complete 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 at this error, I see that people solve this problem by installing ruby-dev packages, however this does not exist for Arch Linux. Any other option I can try?

Thanks in advance!

+4
source share
2 answers

To create your own extensions, you need a C ++ compiler and tools. This is clearly stated:

 sh: make: command not found 

With the exception of the make utility, you obviously need the compiler itself (e.g. gcc ) and the company. In this way,

 sudo apt-get install gcc 

will do the trick. BTW, the RVM path correctly proposed above will definitely require the creation of tools.

+6
source

try the following commands

sudo apt-get install ruby1.9.1-dev build-essential

sudo apt-get install ruby-compass

+1
source

Source: https://habr.com/ru/post/1488901/


All Articles