我正在使用Arch Linux并安装了Ruby(版本为2.0.0)。
在安装Ruby时,它告诉我应该添加:
$(ruby -rubygems -e "puts Gem.user_dir")/bin
为了让命令能够全局使用,我将它添加到了.bashrc文件中。
当我尝试安装rails或其他gem时,出现“Error: Failed to build gem native extension”错误。以下是完整的错误信息:
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.
当我查找此错误时,我发现人们通过安装ruby-dev软件包来解决此错误,但是这在Arch Linux中不存在。还有其他选项可以尝试吗?
提前致谢!