2016-12-28 12 views
2

Redmineのインストール。 私は試しました。Gem :: Ext :: BuildError:エラー:Gemネイティブ拡張をビルドできませんでした。 on CenOS 6.5

bundle install --without development test postgresql sqlite 

ですが、エラーです。

Gem :: Ext :: BuildError:エラー:Gemネイティブ拡張をビルドできませんでした。

current directory: 
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
/usr/local/bin/ruby -r ./siteconf20161228-21055-1dxe9y9.rb extconf.rb 
creating Makefile 

current directory: 
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
make "DESTDIR=" clean 

current directory: 
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
make "DESTDIR=" 
compiling generator.c 
generator.c: In function ‘generate_json’: 
generator.c:861: error: ‘rb_cFixnum’ undeclared (first use in this 
function) 
generator.c:861: error: (Each undeclared identifier is reported only 
once 
generator.c:861: error: for each function it appears in.) 
generator.c:863: error: ‘rb_cBignum’ undeclared (first use in this 
function) 
At top level: 
cc1: warning: unrecognized command line option "-Wno-self-assign" 
cc1: warning: unrecognized command line option 
"-Wno-constant-logical-operand" 
cc1: warning: unrecognized command line option 
"-Wno-parentheses-equality" 
cc1: warning: unrecognized command line option 
"-Wno-tautological-compare" 
make: *** [generator.o] error 1 

make failed, exit code 2 

Gem files will remain installed in 
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection. 
Results logged to 
/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/json-1.8.3/gem_make.out 

An error occurred while installing json (1.8.3), and Bundler 
cannot continue. 
Make sure that `gem install json -v '1.8.3'` succeeds before 
bundling. 

私はgem install json -v '1.8.3を試しましたが、解決できませんでした。

この問題をお読みください。

答えて

1

ルビー2.4はあなたの問題を解決する必要があります実行して解決します非常に新しい。実際、それはわずか3日前にリリースされました。

Ruby 2.4にはいくつかの内部的な変更がありますので、このバージョンのRubyでは多くの宝石(およびRedmine自体)がまだ互換性がない可能性が非常に高いです。

エラーメッセージから、実際にRuby 2.4で整数に関するいくつかの変更を処理するためにJSON gemを適合させる必要があるようです。

Rubyの古いバージョンを使用する必要があります。 Ruby 2.3.3。 http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Ruby-interpreterにあるように、RedmineはRedmineのバージョンに応じて特定のRubyバージョンを必要とします。

+1

のために、特に、後方互換性を壊した場合...それはルビー2.4はJSON 1.8.3をサポートしていないことを意味します。次に、任意の情報安定したが(ありますか? )rubyのバージョンに続く宝石リスト 自分で検索するキーワードを知りたいのですが、 – Johnson

+0

それぞれの宝石はそれぞれ独自の互換性の仕組みを実装していますので、必ずドキュメントを読んでみてください。また、 "[gemname] ruby​​ 2.4"または "[gemname] [error message]"についてもgoogleを利用できます。 jsonの宝石については、Ruby 2.4 [json 2.0以降](https://github.com/flori/json/blob/master/CHANGES.md#2015-09-11-200)をサポートしています。必要な変更は[1.8ブランチにバックポートされました](https://github.com/flori/json/issues/308)、まだリリースされていません。 –

0

最初の実行

gem install bundler 

それは新しいバンドラをインストールし、ネイティブ拡張の依存関係

が、その後

bundle install 

はそれが

0

私は今同じ問題がありました。 gem installを使用して手動でbundlerrmagickの最新バージョンをインストールするには、他のすべてのパッケージをgem updatebundle updateにアップデートしてください。 これにより、json 1.8.3ruby 2.4というこの依存関係の問題が解決されました。

しかし、私は後でいくつかの問題を抱えています。 ruby 2.4のような縫い目は、数字の解釈に若干の変更を行います。つまり、rail 4.xと互換性がないことを意味します。(see this post) Redmineのは activemodel (< 5.0, >= 4.0.1)に依存し、rails 5.xactivemodel 5.xに依存protected_attributesを必要とrailsとその依存関係の更新 はまだありませんpossiblesのようです。

それは常に悪いアップデートは、プログラミング言語:(私が見る

関連する問題