我正在使用 Arch Linux 并安装了 Ruby(这是 2.0.0 版)。
当我安装 Ruby 时,它说我应该添加:
$(ruby -rubygems -e "puts Gem.user_dir")/bin
在我的路径中,我将其添加到 .bashrc
当我尝试 gem install rails 或任何其他 gem 时,它会给出错误:无法构建 gem 本机扩展。这是完整的错误:
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 不存在。我可以尝试任何其他选择吗?
提前致谢!