ruby-on-rails 安装racc(1.6.1)时出错,Bundler无法继续

f45qwnt8  于 2023-01-27  发布在  Ruby
关注(0)|答案(1)|浏览(218)
HW: Mac Intel silicon
OS: MacOS Ventura - Version 13.1
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin21]
rails 7.0.2.2

在我安装MacOS Ventura更新后,我在尝试“捆绑安装”时遇到了一个错误,并出现了一些错误。
我在谷歌上搜索了一些,然后做了以下操作:

xcode-select --install

完成后,我还确保开发人员工具可以访问终端(通过设置UI)。
我再次运行捆绑包安装,结果相同:

Installing racc 1.6.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
/Users/my-mac/.asdf/installs/ruby/3.1.0/bin/ruby -I /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/3.1.0 -r ./siteconf20230126-46139-whcmb7.rb extconf.rb
checking for rb_block_call()... yes
checking for rb_ary_subseq()... yes
creating Makefile

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\= clean

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\=
compiling cparse.c
linking shared-object racc/cparse.bundle
ld: warning: -undefined dynamic_lookup may not work with chained fixups

current directory: /Users/my-mac/.asdf/installs/ruby/3.1.0/lib/ruby/gems/3.1.0/gems/racc-1.6.1/ext/racc/cparse
make DESTDIR\= install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.sitearchdir.-.racc.time] Error 1

make install failed, exit code 2

....

An error occurred while installing racc (1.6.1), and Bundler cannot continue.

In Gemfile:
  rails was resolved to 7.0.2.2, which depends on
    actioncable was resolved to 7.0.2.2, which depends on
      actionpack was resolved to 7.0.2.2, which depends on
        actionview was resolved to 7.0.2.2, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            nokogiri was resolved to 1.13.10, which depends on
              racc

捆绑安装过去工作正常。我也检查了,我没有一个

/usr/local/bin/gmkdir

or

/opt/local/bin/gmkdir

有什么想法吗?

oalqel3c

oalqel3c1#

该编译进程正在查找名为“gmkdir”的mkdir的gnu版本。这是试图使该进程在windows上工作。
由于macOS版本的mkdir可能已经足够,您可以在/user/local/bin中创建一个名为'gmkdir'的mkdir别名。
这是一个黑客,直到宝石安装过程被更新,以实现它的macOS上,并不试图建立一个未知的操作系统的默认基础上。

相关问题