gpt4 book ai didi

ruby-on-rails - 安装 mini_racer (0.2.0) 时出错

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

我使用的是 mac 10.14。我对 mini_racer gem 有一些疑问。运行 bundle install 后出现以下错误。我不知道该如何解决。

错误

Installing mini_racer 0.2.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/vipinkumar/.rvm/gems/ruby-2.5.1@ry_rails5/gems/mini_racer-0.2.0/ext/mini_racer_extension
/Users/vipinkumar/.rvm/rubies/ruby-2.5.1/bin/ruby -r
./siteconf20180911-791-fpmt3t.rb extconf.rb
checking for -lpthread... yes
checking for -lobjc... yes
creating Makefile

current directory:
/Users/vipinkumar/.rvm/gems/ruby-2.5.1@ry_rails5/gems/mini_racer-0.2.0/ext/mini_racer_extension
make "DESTDIR=" clean

current directory:
/Users/vipinkumar/.rvm/gems/ruby-2.5.1@ry_rails5/gems/mini_racer-0.2.0/ext/mini_racer_extension
make "DESTDIR="
compiling mini_racer_extension.cc
clang: warning: argument unused during compilation: '-rdynamic'
[-Wunused-command-line-argument]
In file included from mini_racer_extension.cc:2:
In file included from
/Users/vipinkumar/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby.h:33:
In file included from
/Users/vipinkumar/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:2040:
/Users/vipinkumar/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/intern.h:47:19:
warning: 'register' storage class specifier is deprecated and incompatible with
C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
/Users/vipinkumar/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/intern.h:47:36:
warning: 'register' storage class specifier is deprecated and incompatible with
C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
2 warnings generated.
linking shared-object mini_racer_extension.bundle
clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mini_racer_extension.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/vipinkumar/.rvm/gems/ruby-2.5.1@ry_rails5/gems/mini_racer-0.2.0 for
inspection.
Results logged to
/Users/vipinkumar/.rvm/gems/ruby-2.5.1@ry_rails5/extensions/x86_64-darwin-18/2.5.0/mini_racer-0.2.0/gem_make.out

An error occurred while installing mini_racer (0.2.0), and Bundler
cannot continue.
Make sure that `gem install mini_racer -v '0.2.0' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
mini_racer

Ruby 版本 2.5.0 或 2.5.1 和 rails 5.0

gem 文件

gem 'mini_racer', platforms: :ruby

最佳答案

我在 OS X Mojave 上遇到了完全相同的问题,堆栈跟踪与上面完全相同。以下解决方案为我修复了它:(感谢此博客作者 Dave Kimura):https://blog.driftingruby.com/updated-to-mojave/解决方案很简单:

  1. 确保您已经安装了 xcode 工具(如果已经安装则跳过)

    xcode-select --install

  2. 现在运行以下命令并按照屏幕上的安装程序进行操作

    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

就是这样。现在 mini_racer 应该可以顺利安装了。

关于ruby-on-rails - 安装 mini_racer (0.2.0) 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52264369/

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