前提・実現したいこと
macOS Catalina 10.15にアップデートしてから、railsコマンドが使えないため、これを解決したいです。
bundle install実行中にエラーが発生してしまいます。
発生している問題・エラーメッセージ
railsコマンドを叩くとこのように表示されます。
Could not find libv8-3.16.14.19 in any of the sources Run `bundle install` to install missing gems.
bundle installの実行結果が以下です。
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://rubygems.org/...... Using rake 12.3.3 (略) Using kaminari 1.1.1 Fetching libv8 3.16.14.19 Installing libv8 3.16.14.19 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/ext/libv8 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20191025-1127-h3rg3y.rb extconf.rb creating Makefile Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/disable-building-tests.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/disable-werror-on-osx.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/disable-xcode-debugging.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/do-not-imply-vfp3-and-armv7.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/do-not-use-MAP_NORESERVE-on-freebsd.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/do-not-use-vfp2.patch Applying /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/patches/fPIC-for-static.patch Compiling v8 for x64 Using python 2.7.16 Using compiler: c++ (clang version 11.0.0) Unable to find a compiler officially supported by v8. It is recommended to use GCC v4.4 or higher Beginning compilation. This will take some time. Building v8 with env CXX=c++ LINK=c++ /usr/bin/make x64.release ARFLAGS.target=crs werror=no GYP_GENERATORS=make \ build/gyp/gyp --generator-output="out" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=x64 \ -S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror='' CXX(target) /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from ../src/allocation.cc:33: ../src/utils.h:33:10: fatal error: 'climits' file not found #include <climits> ^~~~~~~~~ 1 warning and 1 error generated. make[1]: *** [/Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o] Error 1 make: *** [x64.release] Error 2 /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound) from /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `each' from /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `verify_installation!' from /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:26:in `install!' from extconf.rb:7:in `<main>' extconf failed, exit code 1 Gem files will remain installed in /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/gems/libv8-3.16.14.19 for inspection. Results logged to /Users/ユーザ名/フォルダ名/フォルダ名/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/libv8-3.16.14.19/gem_make.out An error occurred while installing libv8 (3.16.14.19), and Bundler cannot continue. Make sure that `gem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: therubyracer was resolved to 0.12.3, which depends on libv8
指示通りgem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/'を実行した結果がこちらです。
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
試したこと
https://teratail.com/questions/218281
こちらと、いただいたご回答から、
・~/.zshrcファイルを作り、
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
を記述。
・source ~/.zshrcを実行し、which ruby の実行結果が
/usr/bin/rubyから/Users/ユーザ名/.rbenv/shims/ruby
に変わった
・brew install rbenv ruby-buildを実行してからbundle installを実行したが、
実行結果は変わらず、続いてエラーメッセージで指示された
gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/'
を実行した結果が以下のとおりです。
Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/ext/mysql2 /Users/ユーザ名/.rbenv/versions/2.3.6/bin/ruby -r ./siteconf20191025-5257-9uxwbc.rb extconf.rb checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() in ruby/thread.h... yes checking for rb_thread_blocking_region()... no checking for rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes checking for rb_intern3()... yes checking for rb_big_cmp()... yes ----- Using mysql_config at /usr/local/bin/mysql_config ----- checking for mysql.h... yes checking for errmsg.h... yes checking for SSL_MODE_DISABLED in mysql.h... yes checking for SSL_MODE_PREFERRED in mysql.h... yes checking for SSL_MODE_REQUIRED in mysql.h... yes checking for SSL_MODE_VERIFY_CA in mysql.h... yes checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes checking for MYSQL.net.vio in mysql.h... yes checking for MYSQL.net.pvio in mysql.h... no checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes ----- Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load ----- ----- Setting libpath to /usr/local/Cellar/mysql/5.7.19/lib ----- creating Makefile To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-17/2.3.0-static/mysql2-0.4.10/mkmf.log current directory: /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/ext/mysql2 make "DESTDIR=" clean current directory: /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/ext/mysql2 make "DESTDIR=" compiling infile.c compiling client.c compiling mysql2_ext.c compiling statement.c compiling result.c result.c:326:40: warning: incompatible pointer types assigning to 'my_bool *' (aka 'char *') from 'bool *' [-Wincompatible-pointer-types] wrapper->result_buffers[i].is_null = &wrapper->is_null[i]; ^ ~~~~~~~~~~~~~~~~~~~~ result.c:328:40: warning: incompatible pointer types assigning to 'my_bool *' (aka 'char *') from 'bool *' [-Wincompatible-pointer-types] wrapper->result_buffers[i].error = &wrapper->error[i]; ^ ~~~~~~~~~~~~~~~~~~ 2 warnings generated. linking shared-object mysql2/mysql2.bundle ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [mysql2.bundle] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10 for inspection. Results logged to /Users/ユーザ名/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-17/2.3.0-static/mysql2-0.4.10/gem_make.out
補足情報(FW/ツールのバージョンなど)
OS:macOS Catalina 10.15
ruby -v:ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
rbenv -v:rbenv 1.1.2
初心者で、ご回答に何度も追加質問することもあるかもしれませんが、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/25 06:49
退会済みユーザー
2019/10/25 06:52
2019/10/25 07:01
退会済みユーザー
2019/10/25 07:04
2019/10/25 07:29
退会済みユーザー
2019/10/25 07:32
2019/10/25 07:38
退会済みユーザー
2019/10/25 07:41
2019/10/25 07:51
退会済みユーザー
2019/10/25 07:54