LoginSignup
3
3

More than 5 years have passed since last update.

MacOSX Mavericks にアップデート後、環境を整え、 heroku を利用できる様にする

Last updated at Posted at 2014-03-27

MacOSX を Mavricks にアップデート

AppStoreから行います

Xcode を 4.6.3 以上にアップデート

これも AppStore から行います。

Command-line tools のインストール

hoge% xcode-select --install

ポップアップが出るからそれに従ってcommandline toolsをいれる

brew update して出てくるエラーに対応

例えば以下の様な。

hoge% brew update
エラーメッセージ

hoge% brew link autoconf
Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created

その他、メモ

  • 以前入れてあった rbenv コマンドが通らなくなっていた
  • 以前は1.8系がデフォルトで入っていたrubyのバージョンが、2.0.0デフォルトに変わっていた

Mavericksにしたら一気に変わった…

ブラウザから heroku toolbelt を入れる

チェック

hoge% heroku
Usage: heroku COMMAND [--app APP] [command-specific-options]

動いた!!

herokuアカウントに公開鍵を追加

鍵を作るには macのターミナルなどでssh-keygenで作成することも出来ます。
以下のURLから鍵を追加します。

https://dashboard.heroku.com/account

Herokuにすでにプログラムを上げてある場合 - リポジトリの clone

Heroku鯖からコードをローカルに持ってきます。

リモートリポジトリのURLを確認

git@heroku.com:{hogehoge}.git

heroku コマンドを使う場合

heroku git:clone {hogehoge}  
hoge% git clone git@heroku.com:{hogehoge}.git これと同じ効果)

確認。

hoge% git remote
heroku

リモートリポジトリにherokuが追加されます

Git コマンドで行う場合

↑をcloneします

hoge% git clone git@heroku.com:{hogehoge}.git

これでローカル環境にリポジトリが出来ます。
でもこのままだとリモートリポジトリがoriginのままだから、名前を変更します。

hoge% git remote rename <old> <new>

確認のコマンドは以下。

hoge% git remote

前日譚 Mavericksにアップデートする前の話

環境調査

PCを昔のものを使い始めた。
そしたらherokuが使えないからheroku toolbeltを再インストールすることにした。

hoge% sudo gem install heroku
Password:
ERROR:  Error installing heroku:
    mime-types requires Ruby version >= 1.9.2.

む?Rubyのバージョンが古いのかな?

hoge% ruby -v 
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

2010年くらいに買ったMacBookProを使っているので、デフォルトのRubyのバージョンが古い。

hoge% brew install rbenv
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: rbenv-0.3.0 already installed
hoge% brew install ruby-build
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: ruby-build-20121120 already installed

どうやら、rbenv, ruby-buildはインストールされている。
でもバージョンは古いみたい。

てことで、アップデートしたい。

Git における SSL 問題

hoge% brew update
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/mxcl/homebrew/info/refs
fatal: HTTP request failed
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

アップデートできないので、エラーを直していく。

hoge% git config --global --add http.sslVerify false  

そうすると

hoge% brew update
Checking out files: 100% (3122/3122), done.
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renamelimit variable to at least 862 and retry the command.
Error: undefined method `to_sym' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/cmd/update.rb:99:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:97:in `each_line'
/usr/local/Library/Homebrew/cmd/update.rb:97:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:18:in `update'
/usr/local/bin/brew:94:in `send'
/usr/local/bin/brew:94

なので、なんとかすることに。
おきまりのbrew doctorで。

brew doctor

hoge% brew doctor
sudo mv /opt/local ~/macports
brew install freetype libpng libtool
Warning: Your Xcode (4.5.2) is outdated
Please update to Xcode 4.6.3.
Xcode can be updated from the App Store.

上記の様な表示が出るので、それぞれ対応をします。

hoge% brew update
Already up-to-date.

hoge% brew upgrade ruby-build
Warning: Your Xcode (4.5.2) is outdated
Please update to Xcode 4.6.3.

でもXcodeが古いから、まだエラーがでる。
というわけで、AppStoreからXcodeをアップグレード。
でも、MacOSXをバージョンアップさせないといけないから、します。

で、xcodeもversion5にアップデート。
これに1日掛かった。。。Wimax非推奨。。。

3
3
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
3
3