![](/img/trans.png)
[英]ArgumentError when upgrading from Ruby 2.7 to 3.0 - related to separation of positional and keyword arguments?
[英]Troubles upgrading from ruby 2.7 to 3.0
大約一周以來,我一直在努力嘗試升級 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,但我真的不了解這個環境的東西,所以如果有人有任何我可以閱讀的資源會有所幫助,我將不勝感激。 如果我遺漏了任何重要信息,我深表歉意。 請告訴我,我會盡快回復
試試這個我希望對你有用
brew update
brew upgrade
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
rbenv install 3.0.3
rbenv rehash
終於找到了解決辦法。 基本上有一個操作系統更新,並且一些命令工具更新沒有出現。 在強制更新命令工具后,它更新為 rub 3.0.3,沒有任何問題。
我試過了
sudo xcode-select -s /Library/Developer/CommandLineTools
然后再次安裝 ruby。 希望對你有用
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.