0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rbenv install 2.7.0 Error

Posted at

ログをちゃんと読もう

  • macOS Ventura 13.2
  • Apple M1 Pro
  • rbenv 1.2.0
  • Homebrew 4.0.1

OpenSSLが見つからない

LoadErrorで落ちてる

log
... 中略...

/private/var/folders/yr/0fzl7t0j0wdgl7p199g3jqt80000gq/T/ruby-build.20230220115528.29723.pqOpVp/ruby-2.7.0/lib/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- openssl (LoadError)
	from /private/var/folders/yr/0fzl7t0j0wdgl7p199g3jqt80000gq/T/ruby-build.20230220115528.29723.pqOpVp/ruby-2.7.0/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
	from /private/var/folders/yr/0fzl7t0j0wdgl7p199g3jqt80000gq/T/ruby-build.20230220115528.29723.pqOpVp/ruby-2.7.0/lib/rubygems/specification.rb:2426:in `to_ruby'
	from ./tool/rbinstall.rb:841:in `block (2 levels) in install_default_gem'
	from ./tool/rbinstall.rb:278:in `open_for_install'
	from ./tool/rbinstall.rb:840:in `block in install_default_gem'
	from ./tool/rbinstall.rb:830:in `each'
	from ./tool/rbinstall.rb:830:in `install_default_gem'
	from ./tool/rbinstall.rb:794:in `block in <main>'
	from ./tool/rbinstall.rb:945:in `block in <main>'
	from ./tool/rbinstall.rb:942:in `each'
	from ./tool/rbinstall.rb:942:in `<main>'
make: *** [do-install-all] Error 1

rbenvのdocsにちゃんと注意書きがあるので読みましょう。

Ruby versions 2.x–3.0 の場合

brew install openssl@1.1 readline libyaml gmp
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"

参考
https://blog.ingage.jp/entry/2022/11/22/093000

ffi関連のError

なんか怒られている
implicit declaration of function 'ffi_prep_closure' is invalid in C99

log
closure.c:264:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
             ^
6 warnings and 1 error generated.
make[2]: *** [closure.o] Error 1

... 中略 ...

../.././include/ruby/ruby.h:409:33: note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
make[1]: *** [ext/fiddle/all] Error 2
make[1]: *** Waiting for unfinished jobs....

... 中略 ...

422 warnings generated.
compiling ../.././ext/psych/yaml/writer.c
2 warnings generated.
linking shared-object date_core.bundle
8 warnings generated.
16 warnings generated.
linking shared-object stringio.bundle
4 warnings generated.
linking shared-object zlib.bundle
linking shared-object psych.bundle
make: *** [build-ext] Error 2

同様のIssueが上がっており解決法も提示されている

export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC

参考
https://zenn.dev/grinch1252/scraps/62e4df5575e70c

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?