Error when installing Ruby on Rails: “Failed to build gem native extension”

后端 未结 10 1712
太阳男子
太阳男子 2020-12-28 13:29

I\'m running Crunchbang 11 (Debian-based).

I\'m trying to install Ruby on Rails, like this:

gem install rails --version 4.0.0

I ge

10条回答
  •  佛祖请我去吃肉
    2020-12-28 14:05

    On Fedora 30, I ran into this problem "Failed to build gem native extension". The log error was "gcc: fatal error: cannot read spec file ‘/usr/lib/rpm/redhat/redhat-hardened-cc1’: No such file or directory". The solution was found here.

    If you installed all the above, but the extensions would still not compile, you are probably running a Fedora image that misses redhat-rpm-config package. In that case gcc compiler would complain about one of the following:
    
    gcc: error: conftest.c: No such file or directory
    gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
    To solve this, simply run sudo dnf install redhat-rpm-config.
    

提交回复
热议问题