从 ruby 2.7 升级到 3.0 时遇到问题 - 错误:使用未声明的标识符“RUBY_FUNCTION_NAME_STRING”
我已经在努力尝试升级 Rails 3.0 大约一周了。
我不完全确定问题是什么,但我认为这可能是因为我同时拥有 rvm 和 rbenv。
我在这里遵循了 gorails 的升级教程: https://gorails.com/setup/osx/ 12-monterey
但是每当我运行:
$ rbenv install 3.0.3
时,我都会收到以下错误:
In file included from compile.c:40:
./vm_callinfo.h:217:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
if (debug) rp(ci);
^
./internal.h:95:72: note: expanded from macro 'rp'
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
这里还查看我的错误日志:
In file included from compile.c:40:
./vm_callinfo.h:217:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
if (debug) rp(ci);
^
./internal.h:95:72: note: expanded from macro 'rp'
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
^
2 errors generated.
make: *** [compile.o] Error 1
我是一名编码的初级开发人员大多数时候是 RoR,但我确实不了解这种环境的东西,所以如果有人有任何我可以阅读的资源,这会有所帮助,我将不胜感激。如果我遗漏了任何重要信息,我深表歉意。请告诉我,我会尽快回复
I've been struggling with trying to upgrade rails 3.0 for about a week now.
I'm not entirely sure what the issue is but I was thinking it could be due to the fact that I have both rvm and rbenv.
I've followed the upgrade tutorial from gorails here: https://gorails.com/setup/osx/12-monterey
But whenever I run:
$ rbenv install 3.0.3
I get the following error:
In file included from compile.c:40:
./vm_callinfo.h:217:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
if (debug) rp(ci);
^
./internal.h:95:72: note: expanded from macro 'rp'
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
Here is also a look at my error logs:
In file included from compile.c:40:
./vm_callinfo.h:217:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
if (debug) rp(ci);
^
./internal.h:95:72: note: expanded from macro 'rp'
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
^
2 errors generated.
make: *** [compile.o] Error 1
I'm a junior dev who coded a majority of the time RoR but I truly do not understand this environment stuff, so if anyone has any resources that I could read up on that would help, it would be much appreciated. If I left out any crucial information, my apologies. Just let me know and I'll try to respond as quickly as possible
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
该问题是由 Xcode 命令行工具过时引起的。使用以下脚本强制更新 Xcode 命令行工具。
The problem is caused by Xcode command line tools being outdated. Use the following script to force update Xcode command line tools.
我试过
然后再次安装 ruby。希望对你有用
I tried
then install ruby again. Hope that work for you
试试这个我希望对你有用
Try this I hope that work for you
终于找到解决办法了。本质上是操作系统更新以及一些未显示的命令工具更新。强制更新命令工具后,它更新到 rub 3.0.3,没有任何问题。
Finally found a solution. Essentially there was an OS update and with that some command tool updates that weren't showing up. After forcing the update for the command tools it updated to rub 3.0.3 without any issues.