gpt4 book ai didi

ruby-on-rails - 错误 : Error installing racc: ERROR: Failed to build gem native extension

转载 作者:行者123 更新时间:2023-12-04 11:42:41 26 4
gpt4 key购买 nike

  • Ubuntu 20.04.2 LTS
  • 安装 Rails 6.1.3.1
  • ruby :2.6.5

  • 安装 rails : gem install rails -v 6.1.3.1 --no-doc安装 racc-1.5.2 失败
    尝试手动安装 racc-1.5.2: gem install racc -v '1.5.2' --source 'https://rubygems.org/' --no-doc产生相同的错误。
    以下是错误的“已编辑”输出:
    $ gem install rails -v 6.1.3.1 --no-doc

    Fetching racc-1.5.2.gem
    Fetching zeitwerk-2.4.2.gem
    ...
    Successfully installed rack-2.2.3
    Successfully installed rack-test-1.1.0
    Building native extensions. This could take a while...
    ERROR: Error installing rails:
    ERROR: Failed to build gem native extension.

    current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
    /home/user/.rvm/rubies/ruby-2.6.5/bin/ruby -I /home/user/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210503-658786-pkp97m.rb extconf.rb
    checking for rb_ary_subseq()... yes
    creating Makefile

    current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
    make "DESTDIR=" clean

    current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
    make "DESTDIR="
    compiling cparse.c
    linking shared-object racc/cparse.so

    current directory: /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2/ext/racc/cparse
    make "DESTDIR=" install
    make: /usr/bin/mkdir: Command not found
    make: *** [Makefile:202: .sitearchdir.-.racc.time] Error 127

    make install failed, exit code 2

    Gem files will remain installed in /home/user/.rvm/gems/ruby-2.6.5@gemset/gems/racc-1.5.2 for inspection.
    Results logged to /home/user/.rvm/gems/ruby-2.6.5@gemset/extensions/x86_64-linux/2.6.0/racc-1.5.2/gem_make.out


    最佳答案

    这里的主要问题是命令 mkdir在特定位置被调用,但它不存在:make: /usr/bin/mkdir: Command not found要解决此问题,您需要向该位置添加符号链接(symbolic link):$ sudo ln -s /bin/mkdir /usr/bin/mkdir运行gem install再次访问 rails一切都应该很好!
    感谢用户 dem1tris 提出相关主题并提供答案:make: /usr/bin/mkdir: Command not found during `gem install nokogiri` in Ubuntu 20.04

    关于ruby-on-rails - 错误 : Error installing racc: ERROR: Failed to build gem native extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67375895/

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