2017-02-18 31 views
3

初めてGitHubからリポジトリをクローンしました。エラー:ojのインストール中にエラーが発生しました:

私のMac上のローカルリポジトリ内私は、次のコマンド

ビン/レール・サーバ

を走ったので、私は、次のエラーを得た、私のローカルマシン上でそれをチェックアウトするために行ってきました:

いずれかのソースでactivesupport-5.0.0.1が見つかりませんでした。紛失した宝石をインストールするにはbundle installを実行してください。

は、だから私は、その後、提案としてバンドルinstallコマンドを実行しましたが、それは私にOJ(2.12.14)をインストール中にエラーが発生しました次のエラー

を与えた、とバンドラーは続行できません。 バンドルする前にgem install oj -v '2.12.14'が成功していることを確認してください。だから、

私が走った提案として:宝石(下記参照)その後、私は警告と本当に長いメッセージとエラーを得たOJ -v「2.12.14」

をインストールします。何かご意見は?

ERROR: Error installing oj: 
ERROR: Failed to build gem native extension. 

    current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj 

/usr/local/opt/ruby/bin/ruby -r ./siteconf20170218-3717-1p2bvl9.rb extconf.rb 

>>>>> Creating Makefile for ruby version 2.4.0 on x86_64-darwin16 <<<<< 

creating Makefile 



current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj 

make "DESTDIR=" clean 



current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj 

make "DESTDIR=" 

compiling cache8.c 

compiling circarray.c 

compiling compat.c 

compiling dump.c 

dump.c:503:8: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] 

     cnt = RSTRING_LEN(rstr); 

      ~ ^~~~~~~~~~~~~~~~~ 

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_LEN' 

    RSTRING_EMBED_LEN(str) : \ 

    ^~~~~~~~~~~~~~~~~~~~~~ 

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:972:6: note: expanded from macro 'RSTRING_EMBED_LEN' 

    (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \ 

    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

dump.c:503:8: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] 

     cnt = RSTRING_LEN(rstr); 

      ~ ^~~~~~~~~~~~~~~~~ 

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:977:28: note: expanded from macro 'RSTRING_LEN' 

    RSTRING(str)->as.heap.len) 

    ~~~~~~~~~~~~~~~~~~~~~~^~~ 

dump.c:1776:39: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations] 

     for (i = (int)RSTRUCT_LEN(obj), vp = RSTRUCT_PTR(obj); 0 < i; i--, vp++) { 

              ^

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:1190:33: note: expanded from macro 'RSTRUCT_PTR' 

#define RSTRUCT_PTR(st)   rb_struct_ptr(st) 

           ^

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/intern.h:889:25: note: 'rb_struct_ptr' has been explicitly marked deprecated here 

DEPRECATED(const VALUE *rb_struct_ptr(VALUE s)); 

         ^

dump.c:1776:37: warning: assigning to 'VALUE *' (aka 'unsigned long *') from 'const VALUE *' (aka 'const unsigned long *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 

     for (i = (int)RSTRUCT_LEN(obj), vp = RSTRUCT_PTR(obj); 0 < i; i--, vp++) { 

             ^~~~~~~~~~~~~~~~~ 

4 warnings generated. 

compiling err.c 

compiling fast.c 

fast.c:816:17: warning: 'rb_data_object_alloc' is deprecated: by rb_data_object_wrap [-Wdeprecated-declarations] 

    doc->self = rb_data_object_alloc(clas, doc, 0, free_doc_cb); 

       ^

/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:1379:1: note: 'rb_data_object_alloc' has been explicitly marked deprecated here 

rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree) 

^ 

fast.c:1280:24: error: use of undeclared identifier 'rb_cFixnum' 

     case T_FIXNUM: type = rb_cFixnum;  break; 

          ^

1 warning and 1 error generated. 

make: *** [fast.o] Error 1 



make failed, exit code 2 



Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14 for inspection. 

Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/oj-2.12.14/gem_make.out 

答えて

6

Fixnumはもはやルビ2.4ではなくなりました。あなたのルビをダウングレードするか、ojを2.16.1にアップデートしてください。これは、ruby 2.4をサポートしています。

+0

ojを2.16.1にアップグレードしようとしました。しかし、再びバンドルしようとしたときに、バンドル前に 'gem install oj -v '2.12.14が成功したことを確認するという同じエラーが表示されました。だから次のアイデアはあなたが提案したようにRubyをダウングレードすることでしたが、私はどのようにこのリポジトリのために行うのですか?私は問題があると思うのは、セットアップルビーが正常にインストールされているということですが、私はリポジトリをクローンしました。おそらく古いバージョンのrubyまたは別のバージョンのojに依存するコードを持っています。私は何とかこのリポジトリのRubyバージョンを設定するためにRVMを使うべきだと思っていますか? –

+0

@KramerKeller 'bundle install'を実行する前に' bundle update oj'を実行して、ojをGemfile.lockの最新バージョンに更新する必要があります。つまり、rvmや別のマネージャを使ってルビーのインストールを管理することは、常に良い考えです。ほとんどの管理者は、ディレクトリ内の_.ruby-version_ファイルを探すことによって使用するルビのバージョンを特定します。あなたがすでにクローンしているリポジトリに既にそれがあったなら、私は驚かないでしょう。 – eiko

+0

RVMを完全に削除しました。私は自分のリポジトリも削除しました。私は新しいファイルを開始し、リポジトリをクローンし、rbenvを動作させました。私は2.3.1をローカルで実行しているのがわかりますが、私はまだ同じエラーが発生しています。 「oj(2.12.14)のインストール中にエラーが発生し、Bundlerは続行できません」と表示されます。バンドル更新ojは同じエラーを返します。 Gemのインストールはruby 2.4を参照しているようです... 2.3.1で私の複製されたリポジトリを操作するにはどうすればよいですか?私もgemfileをチェックして、 'oj'、 '〜> 2.12.14'、そしてGemfile.lockはoj(2.12.14)と言っています。私はルビーを学ぼうとしています...しかし、私のマシンでそれを動作させることはできません。 –

関連する問題