6
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 5 years have passed since last update.

【brew install エラー】config.rb:39:in `initialize': no implicit conversion of nil into String (TypeError)

Last updated at Posted at 2019-01-09

#はじめに
fortranのコンパイラであるgfortranHomebrewでインストールする際に、下記のエラーが発生しました。エラーの具体的解決策ではないものの意外な方法で解決するに至りましたので記事に残しておきます。

同じエラーに遭遇した方々の一助になれば幸いです。

隣にいた仲間も、同じエラーに遭遇し、同じ解決策で解決できましたので割と解決策として有効?な気もしないではないです(ということをはじめに述べておきます)。
#環境

PCの種類 OS Version
MacBook macOS High Sierra 10.13.1
仲間 MacBook Pro macOS High Sierra 10.13.6

#エラー発生

$ brew install gcc
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
esptool            hexyl              libnova            moarvm             nqp                rakudo             switch-lan-play
==> Updated Formulae
yarn ✔             bitrise            ed                 hcloud             lmod               openconnect        tor
akamai             boost              emscripten         jabba              lxc                picard-tools       urdfdom_headers
alexjs             brew-php-switcher  erlang@20          jenkins            mariadb            primesieve         vegeta
amqp-cpp           buildifier         eslint             kitchen-sync       mercurial          rabbitmq           vim
aws-sdk-cpp        chakra             exploitdb          libetpan           mkcert             restic             wget
azure-cli          citus              fonttools          libidn2            mkvtoolnix         serverless         whois
bash               clang-format       fselect            libphonenumber     mutt               sox                wp-cli-completion
bat                conan              git-quick-stats    libpsl             neofetch           swiftlint          wtf
bettercap          console_bridge     grv                libsodium          nvm                telegraf

/usr/local/Homebrew/Library/Homebrew/config.rb:39:in `initialize': no implicit conversion of nil into String (TypeError)
	from /usr/local/Homebrew/Library/Homebrew/config.rb:39:in `new'
	from /usr/local/Homebrew/Library/Homebrew/config.rb:39:in `<top (required)>'
	from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/local/Homebrew/Library/Homebrew/global.rb:25:in `<top (required)>'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:13:in `require_relative'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:13:in `<main>'

#解決
もう一度同じコマンドを実行し直しただけです(奇跡的?)(もちろん以前のコマンドによりPC内部に何らかの変化がないと論理が成り立ちませんが)。

$ brew install gcc
==> Installing dependencies for gcc: gmp, isl, mpfr and libmpc
==> Installing gcc dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.1.2_2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gmp-6.1.2_2.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/gmp/6.1.2_2: 18 files, 3.1MB
==> Installing gcc dependency: isl
==> Downloading https://homebrew.bintray.com/bottles/isl-0.20.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring isl-0.20.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/isl/0.20: 71 files, 3.9MB
==> Installing gcc dependency: mpfr
==> Downloading https://homebrew.bintray.com/bottles/mpfr-4.0.1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mpfr-4.0.1.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/mpfr/4.0.1: 28 files, 4.6MB
==> Installing gcc dependency: libmpc
==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.1.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmpc-1.1.0.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libmpc/1.1.0: 12 files, 353.8KB
==> Installing gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-8.2.0.high_sierra.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring gcc-8.2.0.high_sierra.bottle.2.tar.gz
🍺  /usr/local/Cellar/gcc/8.2.0: 1,413 files, 294.7MB

#確認
gccパッケージをインストールすると、gfortranもインストールされるので、無事インストールされたか確認しましょう。

$ which gfortran
/usr/local/bin/gfortran

もちろん、brew list gccでも構いません。

#おわりに
パッとしない投稿ですが、もし同じエラーに遭遇し、同じように解決できたという方は、コメントなどにてお知らせいただけると嬉しいです! (^^)

6
0
6

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
6
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?