1

最初に試してみます: gem install rails

それは生産します:

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/$(RUBY_BASE_NAME)
    --help
    --clean
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/share/ruby/mkmf.rb:571:in `block in try_compile'
    from /usr/share/ruby/mkmf.rb:522:in `with_werror'
    from /usr/share/ruby/mkmf.rb:571:in `try_compile'
    from extconf.rb:80:in `nokogiri_try_compile'
    from extconf.rb:87:in `block in add_cflags'
    from /usr/share/ruby/mkmf.rb:619:in `with_cflags'
    from extconf.rb:86:in `add_cflags'
    from extconf.rb:336:in `<main>'


Gem files will remain installed in /home/hagoth/.gem/ruby/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /home/hagoth/.gem/ruby/gems/nokogiri-1.6.7.2/ext/nokogiri/gem_make.out

私はsudo dnf install ruby-devel また、それを試してみましたを使用して開発ツールをインストールしrvm requirements ましたそして、私は過去5時間ほどオンラインで他のあいまいなソリューションを試しました. それらのどれも機能していないようです。私が見逃している単純で明白な解決策はありますか?依存関係が存在すると確信しています。私が間違っているかもしれませんが。

それが何かを意味する場合は、Fedora 23 の 32 ビット バージョンを実行します。

アップデート:

の内容は次の/home/username/.gem/ruby/gems/nokogiri-1.6.7.2/ext/nokogiri/mkmf.logとおりです。

"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -D_FILE_OFFSET_BITS=64  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fPIC  conftest.c  -L. -L/usr/lib -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic  -m32   -lruby  -lpthread -ldl -lcrypt -lm   -lc "
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */
4

2 に答える 2

9

パッケージのビルド スクリプトが見つからない特定のファイルを探している理由はよくわかりませんが、パッケージによって提供されてますredhat-rpm-config。デフォルトでFedora Workstationにあるはずだと確信しています。いずれにせよ、システム上でソフトウェアを構築しているため、次のグループがインストールされていることを確認することをお勧めします。

sudo dnf groupinstall development-tools rpm-development-tools c-development 

これにより、この特定の問題が解決され、他の基本的な「ネイティブ」ビルド インフラストラクチャ ツールがインストールされていることが保証されます。

于 2016-01-25T19:53:46.457 に答える
-1

@mattdmの答えに加えて、その解決は失敗します:

vagrant plugin install vagrant-livbirt

パッケージの依存関係の問題が原因です。したがって、上記のコマンドを使用すると解決します!

于 2016-03-06T22:03:49.980 に答える