gpt4 book ai didi

ruby-on-rails - 错误 : Error installing oj:

转载 作者:数据小太阳 更新时间:2023-10-29 06:53:11 27 4
gpt4 key购买 nike

我刚刚第一次从 GitHub 克隆了一个存储库。

我去我的本地机器上检查了它,所以在我的 mac 上的本地存储库中我运行了以下命令

bin/rails 服务器

我收到以下错误:

无法在任何来源中找到 activesupport-5.0.0.1运行 bundle install 以安装缺少的 gem。

然后我按照建议运行了 bundle install 命令,但是它给了我以下错误

安装 oj (2.12.14) 时出错,Bundler 无法继续。确保 gem install oj -v '2.12.14' 在捆绑之前成功。

所以我按照建议运行了:gem install 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

最佳答案

Fixnum 不再是 ruby​​ 2.4 中的东西。要么将你的 ruby​​ 降级,要么将 oj 更新到支持 ruby​​ 2.4 的 2.16.1。

关于ruby-on-rails - 错误 : Error installing oj:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42316668/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com