LoginSignup
0
0

More than 5 years have passed since last update.

macOS Sierraにhomebrewをインストールする際の落とし穴

Last updated at Posted at 2018-03-05

macOS Sierraにhomebrewをインストールしようとしてエラー

落とし穴

自分のmacにhomebrewをインストールする必要があり、下記のサイトからスクリプトをコピーして実行したがエラーになります。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

実行結果
curl: (1) Protocol "https" not supported or disabled in libcurl

調査

以下のコマンドを実行
mito-macOS:~ mito$ curl -V
curl 7.53.1 (x86_64-apple-darwin16.4.0) libcurl/7.53.1 zlib/1.2.8
Protocols: dict file ftp gopher http imap ldap ldaps pop3 rtsp smtp telnet tftp
Features: IPv6 Largefile libz UnixSockets

デフォルトcurlコマンドではhttpsがプロトコルに入っていないことを確認。
/usr/bin/curl -Vを実行したところhttpsがプロトコルに入っていました。

mito-macOS:~ mito$ /usr/bin/curl -V
curl 7.54.0 (x86_64-apple-darwin16.0) libcurl/7.54.0 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

解決

上記のhomebrewインストールスクリプトを変更し、無事インストールできました。

mito-macOS:~ mito# ruby -e "$(/usr/bin/curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

補足

デフォルトのcurlが/usr/local/bin/curlになっていたので、以下のようにしてデフォルトで/usr/bin/curlが使われるように変更しました。

mito-macOS:~ mito$ cd /usr/local/bin
mito-macOS:bin mito$ ls -l
total 992
lrwxr-xr-x 1 mito admin 28 3 5 12:14 brew -> /usr/local/Homebrew/bin/brew
-rwxr-xr-x 1 root wheel 224 2 27 15:51 chardetect
-rwxr-xr-x 1 root wheel 189388 3 30 2017 curl
-rwxr-xr-x 1 root wheel 4787 3 30 2017 curl-config
-rwxr-xr-x 1 mito wheel 273936 4 7 2017 exiftool
lrwxr-xr-x 1 root wheel 24 6 12 2017 jamf -> /usr/local/jamf/bin/jamf
lrwxr-xr-x 1 root wheel 29 3 8 2017 jamfAgent -> /usr/local/jamf/bin/jamfAgent
drwxr-xr-x 4 mito wheel 136 4 10 2017 lib
-rwxr-xr-x 1 root wheel 281 2 26 17:13 pip
-rwxr-xr-x 1 root wheel 283 2 26 17:13 pip2
-rwxr-xr-x 1 root wheel 287 2 26 17:13 pip2.7
-rwxr-xr-x 1 root wheel 158 2 26 17:47 s3cmd
mito-macOS:bin mito$ mv curl curl.old
mito-macOS:bin mito$ ln -s /usr/bin/curl .
mito-macOS:bin mito$ ls -l
total 1000
lrwxr-xr-x 1 mito admin 28 3 5 12:14 brew -> /usr/local/Homebrew/bin/brew
-rwxr-xr-x 1 root wheel 224 2 27 15:51 chardetect
lrwxr-xr-x 1 mito admin 13 3 5 13:03 curl -> /usr/bin/curl
-rwxr-xr-x 1 root wheel 4787 3 30 2017 curl-config
-rwxr-xr-x 1 root wheel 189388 3 30 2017 curl.old
-rwxr-xr-x 1 mito wheel 273936 4 7 2017 exiftool
lrwxr-xr-x 1 root wheel 24 6 12 2017 jamf -> /usr/local/jamf/bin/jamf
lrwxr-xr-x 1 root wheel 29 3 8 2017 jamfAgent -> /usr/local/jamf/bin/jamfAgent
drwxr-xr-x 4 mito wheel 136 4 10 2017 lib
-rwxr-xr-x 1 root wheel 281 2 26 17:13 pip
-rwxr-xr-x 1 root wheel 283 2 26 17:13 pip2
-rwxr-xr-x 1 root wheel 287 2 26 17:13 pip2.7
-rwxr-xr-x 1 root wheel 158 2 26 17:47 s3cmd

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