【旧版】ローカル開発環境の構築 [MacOS X版]

MacOS X上にローカル開発環境を構築していく方法について見ていきます。
0%
このレッスンはアーカイブされました
このレッスンは視聴可能ですが、質問の受付や内容の更新は終了しております。
#01 ローカル開発環境を構築しよう
2015年8月3日
一度構築したローカル開発環境に対して ./run.sh を実行した後、 vagrant up をおこなうと以下のようなエラーメッセージが表示される場合があります。
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device
このエラーは vagrant-vbguest という Vagrant のプラグインをインストールすることで回避できます。

vagrant-vbguest をインストールするには、お使いの Mac 上で以下のコマンドを実行してください。
vagrant plugin install vagrant-vbguest
2015年1月23日
2015/1/22に自動スクリプトの更新を行い、Node.jsもインストールされるようになりました。すでに環境を構築された方はvagrant sshしたあとに次のコマンドを実行してみてください。
cd
cd centos65
git pull
./run.sh
#04 VagrantでCentOSを立ち上げよう
2016年10月18日
ウィルス対策ソフトをお使いの Mac にインストールしている場合、vagrant up にて box のダウンロードに失敗する場合があります。

この場合、エラーメッセージに表示されている通信先のドメインを許可するか、ウィルス対策ソフト自体をオフにすることで解決します。
2015年8月30日
動画中で「vagrant init chef/centos-6.5」のコマンドを利用していますが、chef/centos-6.5 の box は利用できなくなっています。

代わりに「vagrant init bento/centos-6.7」を利用するようにしてください。
#05 CentOSの設定をしていこう
2016年7月25日
vagrant sshでパスワードを聞かれた場合、初期パスワードの「vagrant」を入力してみてください。
2016年5月30日
./run.sh の実行では yum update のタスクに時間がかかる場合があります。

数十分待っても先へ進まない場合には、一度「Ctrl + c」で実行中の ./run.sh コマンドを終了してから、
sudo yum update -y
を手動で打ち込んで実行してみてください。

そして yum update が終了してから、再度 ./run.sh を実行するようにしてください。
2016年2月18日
./run.sh実行時には様々なプログラムをダウンロードするので、400〜500MB程度の通信量がかかります。通信容量に制限のある環境にいらっしゃる方はご注意ください。
2015年11月6日
./run.shを実行した際に、以下のTASKがfailedになりますが、コマンドの存在チェックをしているだけなので環境の構築には問題ありません(初回は必ずfailedになります)。

TASK: [check rbenv installed]
TASK: [check ruby-build installed]
TASK: [check ruby installed]
TASK: [check node js installed]

安心してインストール作業を進めていただければと思います。
2015年1月6日
動画中のrun.shスクリプトでRubyをインストールしていますが、Rubyは再ログイン後に有効になります。ログインせずに有効化したい場合は以下のコマンドを実行してください。
exec $SHELL -l
#06 CentOSを再び立ち上げてみよう
2016年5月25日
一度構築したローカル開発環境に対して ./run.sh を実行した後、 vagrant up をおこなうと以下のようなエラーメッセージが表示される場合があります。
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device
このエラーは vagrant-vbguest という Vagrant のプラグインをインストールすることで回避できます。

vagrant-vbguest をインストールするには、お使いの Mac 上で以下のコマンドを実行してください。
vagrant plugin install vagrant-vbguest
2016年2月1日
ローカル開発環境なのでそれほど気にする必要はありませんが、前回のスクリプトで仮想サーバーを最新の状態に更新しているので、一度仮想サーバーを再起動しておくといいでしょう。vagrant の場合は、
vagrant reload
で再起動ができます。
#09 Hosts.prefpaneを導入していこう
2015年2月4日
Hosts.prefpaneの入手先は以下のとおりとなります。

・specialunderwear/Hosts.prefpane
https://github.com/specialunderwear/Hosts.prefpane
・ダウンロードリンク
https://github.com/specialunderwear/Hosts.prefpane/downloads