LoginSignup
0
0

More than 1 year has passed since last update.

環境を揃える為にrubyのインストールで出たエラー(M1Mac)

Last updated at Posted at 2021-08-11

課題で環境指定があるため
指定された環境構築を行なっていた中でrubyのverをインストールした時に
起きたエラー

普段の環境:Mac M1 rails6.1.4 ruby3.0.1
指定環境: rails5.2.5 ruby 2.6.3

Downloading openssl-1.1.1k.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
Installing openssl-1.1.1k...
Installed openssl-1.1.1k to /Users/uk./.rbenv/versions/2.6.3

Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.4 using ruby-build 20210526)

Inspect or clean up the working tree at /var/folders/wg/2z1wcj6x01z_q0lqb4jk_jkw0000gn/T/ruby-build.20210810115410.36976.30c1Jy
Results logged to /var/folders/wg/2z1wcj6x01z_q0lqb4jk_jkw0000gn/T/ruby-build.20210810115410.36976.log

Last 10 log lines:
compiling ellipsize.c
compiling normalize.c
compiling modify.c
linking shared-object -test-/tracepoint.bundle
compiling set_len.c
compiling enc_str_buf_cat.c
compiling new.c
linking shared-object -test-/string.bundle
linking shared-object date_core.bundle
make: *** [build-ext] Error 2

**make: ** [build-ext] Error 2***

同じ様にインストール出来ない人のため先人様の情報載せておきます。
M1 の MacBook で rbenv + Ruby 2.6.6 をビルドする

これでrubyはインストール

RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC rbenv install (インストールしたいrubyのver)

そこからrubyのバージョン変更

Rubyのバージョン確認方法と変更方法

ver切り替えコマンド

% rbenv local (切り替えたいrubyのverを入れる)
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