環境
macOS 10.15.5
Rails 5.2.4.2
Docker 19.03.12
前提・実現したいこと
RailsのConsoleでPryを使用していますがこれを日本語入力を可能にしたいです。
しかしエラーになり思うように行きません...
作業手順
$ rbenv version 2.5.8 (set by /Users/Chisaki/Allies/.ruby-version) $ rbenv uninstall 2.5.8 $ brew install readline Updating Homebrew... Warning: readline 8.0.4 is already installed and up-to-date To reinstall 8.0.4, run `brew reinstall readline` $ brew reinstall readline
上記のようにrbenvをreinstallしました。
参照リンク
[Ruby] pryやirbで日本語入力を可能にする
発生している問題・エラーメッセージ
reinstallをしている中たくさんの羅列の中の一部を下記に記載しました。
(省略) Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/2to3 Target /usr/local/bin/2to3 already exists. You may want to remove it: rm '/usr/local/bin/2to3' (省略) Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/aws Target /usr/local/bin/aws already exists. You may want to remove it: rm '/usr/local/bin/aws' (省略)
そして最後に...
Warning: Refusing to link macOS provided/shadowed software: readline For compilers to find readline you may need to set: export LDFLAGS="-L/usr/local/opt/readline/lib" export CPPFLAGS="-I/usr/local/opt/readline/include" For pkg-config to find readline you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
試したこと
下記のコマンドを実行して
$ brew info readline readline: stable 8.0.4 (bottled) [keg-only] Library for command-line editing https://tiswww.case.edu/php/chet/readline/rltop.html /usr/local/Cellar/readline/8.0.4 (49 files, 1.5MB) Poured from bottle on 2020-10-10 at 00:10:41 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/readline.rb License: GPL-3.0 ==> Caveats readline is keg-only, which means it was not symlinked into /usr/local, because macOS provides BSD libedit. For compilers to find readline you may need to set: export LDFLAGS="-L/usr/local/opt/readline/lib" export CPPFLAGS="-I/usr/local/opt/readline/include" For pkg-config to find readline you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig" ==> Analytics install: 390,062 (30 days), 1,318,202 (90 days), 5,378,731 (365 days) install-on-request: 15,274 (30 days), 53,516 (90 days), 403,477 (365 days) build-error: 0 (30 days)
バージョンを確認して下記を実行しました。
$ brew switch readline 8.0.4 Cleaning /usr/local/Cellar/readline/8.0.4 Opt link created for /usr/local/Cellar/readline/8.0.4 ChisakinoMacBook-Pro:Allies Chisaki$ brew link readline --force Warning: Refusing to link macOS provided/shadowed software: readline For compilers to find readline you may need to set: export LDFLAGS="-L/usr/local/opt/readline/lib" export CPPFLAGS="-I/usr/local/opt/readline/include" For pkg-config to find readline you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
しかしエラー内容は変わりませんでした...
参照リンク
MacにおけるRails開発環境におけるreadlineライブラリのバージョン不整合問題への対処
エラーの内容が変わらないので原因がまだわからないというのが正直なところです...。
ぜひこちらのエラー内容についてぜひご教授して頂けないでしょうか。
補足
情報の補足をします。
現在設定されている環境変数はこちらになります。
$ printenv LDFLAGS=-L/usr/local/opt/readline/lib TERM_PROGRAM=vscode PYENV_ROOT=/Users/Chisaki/.pyenv TERM=xterm-256color SHELL=/bin/bash CPPFLAGS=-I/usr/local/opt/readline/include TMPDIR=/var/folders/gc/vr22f7_j1415c1965h9m48500000gn/T/ CONDA_SHLVL=0 TERM_PROGRAM_VERSION=1.35.0 USER=Chisaki CONDA_EXE=/opt/anaconda3/bin/conda SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.T62aYPg5jH/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0x1:0xE _CE_CONDA= PATH=/Users/Chisaki/.rbenv/shims:/Users/Chisaki/.rbenv/shims:/usr/local/bin:/Users/Chisaki/.pyenv/shims:/Users/Chisaki/.pyenv/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/Chisaki/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/Users/Chisaki/.local/bin:/usr/local/bin:/usr/local/opt/mysql@5.6/bin:/Users/Chisaki/.rbenv/shims:/usr/local/opt/mysql@5.6/bin:/usr/local/opt/mysql@5.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/Chisaki/.rbenv/shims:/opt/anaconda3/condabin:/Users/Chisaki/.pyenv/shims:/Users/Chisaki/.pyenv/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/Chisaki/.local/bin:/usr/local/opt/mysql@5.6/bin PWD=/Users/Chisaki/Allies LANG=ja_JP.UTF-8 XPC_FLAGS=0x0 RBENV_SHELL=bash _CE_M= XPC_SERVICE_NAME=0 SHLVL=2 PYENV_SHELL=bash HOME=/Users/Chisaki CONDA_PYTHON_EXE=/opt/anaconda3/bin/python LOGNAME=Chisaki PKG_CONFIG_PATH=/usr/local/opt/readline/lib/pkgconfig _=/usr/bin/printenv
ちなみにエラーの表記にあった環境変数をそのまま実行しましたがダメでした...
$ export LDFLAGS="-L/usr/local/opt/readline/lib" $ export CPPFLAGS="-I/usr/local/opt/readline/include" $ export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
あなたの回答
tips
プレビュー