MBAにrbenvでrubyの環境を整えた
rbenvのインストール
$ brew install rbenv
.bash_profile に rbenvの設定をロード
vi ~/.bash_profile export RBENV_ROOT=$HOME/.rbenv eval "$(rbenv init -)"
各種バージョンのrubyをインストール
$ rbenv install 2.0.0-p0 $ rbenv install 2.0.0-p195 $ rbenv install 2.0.0-p247
globalのrubyのバージョンをセット
$ rbenv global 2.0.0-p247
インストール状態とセットされているrubyを確認
$ rbenv versions system 2.0.0-p0 2.0.0-p195 * 2.0.0-p247 (set by /Users/tknzk/.rbenv/version) $ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.1]
ついでにbundlerのインストール
$ gem install bundler $ rbenv rehash $ bundle -v Bundler version 1.3.5
rbenvでインストールしてバージョンセットして ruby -v としてもsystemデフォルトのものが表示されて若干ハマったけど、.bash_profile のexportの設定を見なおして無事解決 *1
*1:参考にしていた記事が古かった
MySQL5.5 に入れ替えた
先日セットアップしたMBAのMySQLのバージョンを変更した。
先日のセットアップでは、
$ brew install mysql
としてインストールしたもので、mysql5.6だった。
mysql5.6にして何も問題ないよなあと2日ぐらい過ごしていた。ところが、運用しているシステムを動かしたところ、default valueの部分で、エラーが出まくってしまい、ソースの修正では、追いつきそうなく、心が折れそうになったため、mysql5.5に入れ替えを行った。
まずは、mysql5.6をuninstall
$ brew uninstall mysql
homebrew versions を追加 して、mysql55をインストールする
$ brew tap homebrew/versions
$ brew install mysql55
インストールしたあとに
mysql_install_db を実行しようとすると
FATAL ERROR: Could not find errmsg.sys
といわれて怒られてしまう。
/usr/local/Cellar/mysql55/5.5.30/share/mysql55/english/errmsg.sys
をmysql55のところをrenameしたりして、作成することで回避
下記をdatadir として設定
/usr/local/var/mysql55
若干ハマりどころはあったが、なんとかmysql5.5がインストールできた。
とは言うものの、いつまでもmysql5.5にしておくわけには行かないので、
既存のシステムの技術的負債は解消していきたい。
hbstudy#45 に行ってきた
先週末開催されたhbstudy#45に行ってきた。
serverのセットアップ状態の振る舞いをテストするツールのserverspecの話。
作成者の mizzy さんが登壇されて、設計思想の話から、実装方法、コードリーディングまでを行なっていただくとてもいい勉強会でした。
土日でgemにして公開まで持っていったとういう話は、それぐらいの勢いとスピード感が無いとダメなんだろうなあと思った。
contributerの募集の意味も兼ねてのコードリーディングは、とても参考になった。
まずは、インストールをして、使ってみるところから始めてみようと思った。
http://www.slideshare.net/mizzy/serverspec-hbstudy45
登壇されたmizzyさん、主催のハートビーツさん、ありがとうございました!
MacBookAir Setup Memo
MBAをサラの状態からセットアップしたのでそのメモ
セットアップするのに必須なもの
- Xcode & CommandLine Tools
App Store からXcodeをインストール XcodeからCommandLine Toolsをインストール
- Homebrew
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
- make
$ brew install make
開発環境
pythonオプション付きでインストールしたいので依存関係をクリア
$ brew install python $ pip-2.7 install docutils $ brew install mercurial
vim をインストール
$ brew install https://gist.github.com/raw/1027452/7e41f7c5ce2683c3a0ecd2a4ff6cedd7e99a24c5/vim.rb --enable-interp=python,python3,ruby
- mosh
$ brew install mosh
- pwgen
$ brew install pwgen
$ brew install wget
開発用ミドルウェア
$ brew install httpd To have launchd start httpd at login: ln -sfv /usr/local/opt/httpd/*.plist ~/Library/LaunchAgents Then to load httpd now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist
$ brew install mysql A "/etc/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly. To connect: mysql -uroot To have launchd start mysql at login: ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents Then to load mysql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist Or, if you don't want/need launchctl, you can just run: mysql.server start
- memcached
$ brew install memcached To have launchd start memcached at login: ln -sfv /usr/local/opt/memcached/*.plist ~/Library/LaunchAgents Then to load memcached now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist Or, if you don't want/need launchctl, you can just run: /usr/local/opt/memcached/bin/memcached
- redis
$ brew install redis To have launchd start redis at login: ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents Then to load redis now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist Or, if you don't want/need launchctl, you can just run: redis-server /usr/local/etc/redis.conf
- mongodb
$ brew install mongodb To have launchd start mongodb at login: ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents Then to load mongodb now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist Or, if you don't want/need launchctl, you can just run: mongod
- td-agent
$ brew install "http://toolbelt.treasure-data.com/brew/td-agent.rb" td-agent configuration file and plugin directories were created: /usr/local/etc/td-agent/td-agent.conf /usr/local/etc/td-agent/plugin You can invoke td-agent manually via td-agent command without launchctl: td-agent --pid /usr/local/var/run/td-agent/td-agent.pid If you want to know the details of Fluentd, see Fluentd documents at: http://docs.fluentd.org/ To have launchd start td-agent at login: ln -sfv /usr/local/opt/td-agent/*.plist ~/Library/LaunchAgents Then to load td-agent now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.td-agent.plist
- groonga
$ brew install groonga
- kyoto-cabinet / kyoto-tycoon
$ brew install kyoto-cabinet kyoto-tycoon
- php53
$ brew tap homebrew/dupes $ brew tap josegonzalez/php $ brew install php53 --with-mysql --with-apache To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php5_module /usr/local/opt/php53/libexec/apache2/libphp5.so The php.ini file can be found in: /usr/local/etc/php/5.3/php.ini ✩✩✩✩ PEAR ✩✩✩✩ If PEAR complains about permissions, 'fix' the default PEAR permissions and config: chmod -R ug+w /usr/local/Cellar/php53/5.3.25/lib/php pear config-set php_ini /usr/local/etc/php/5.3/php.ini ✩✩✩✩ Extensions ✩✩✩✩ If you are having issues with custom extension compiling, ensure that this php is in your PATH: PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"
$ brew install php53-memcache * /usr/local/etc/php/5.3/conf.d/ext-memcache.ini was created, do not forget to remove it upon extension removal. * Restart your webserver. * Write a PHP page that calls "phpinfo();" * Load it in a browser and look for the info on the memcache module. * If you see it, you have been successful!
$ brew install php53-mongodb To finish installing mongo for PHP 5.3: * /usr/local/etc/php/5.3/conf.d/ext-mongo.ini was created, do not forget to remove it upon extension removal. * Restart your webserver. * Write a PHP page that calls "phpinfo();" * Load it in a browser and look for the info on the mongo module. * If you see it, you have been successful!
$ brew install php53-redis To finish installing redis for PHP 5.3: * /usr/local/etc/php/5.3/conf.d/ext-redis.ini was created, do not forget to remove it upon extension removal. * Restart your webserver. * Write a PHP page that calls "phpinfo();" * Load it in a browser and look for the info on the redis module. * If you see it, you have been successful!
$ brew install php53-apc To finish installing apc for PHP 5.3: * /usr/local/etc/php/5.3/conf.d/ext-apc.ini was created, do not forget to remove it upon extension removal. * Restart your webserver. * Write a PHP page that calls "phpinfo();" * Load it in a browser and look for the info on the apc module. * If you see it, you have been successful! ==> Summary
$ brew install php53-mcrypt To finish installing mcrypt for PHP 5.3: * /usr/local/etc/php/5.3/conf.d/ext-mcrypt.ini was created, do not forget to remove it upon extension removal. * Restart your webserver. * Write a PHP page that calls "phpinfo();" * Load it in a browser and look for the info on the mcrypt module. * If you see it, you have been successful!
Applications
- LimeChat
- iTerm2
- Google Chrome
- Yorufukurou
- dropbox
- evernote
- Marked
その他
- DockにRecently Applicationを表示
$ defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' $ killall Dock
- 共有サーバへの接続問題
$ sudo sysctl -w net.inet.tcp.delayed_ack=0 $ sudo vi /etc/sysctl.conf net.inet.tcp.delayed_ack=0
Boxen試すの忘れた
そういえば、GitHub謹製のセットアップツールを試そうと思ってたけど、すっかり忘れてた。
PDD (Purchase Driven Development)
RubyMotionを購入した。
買ったからには、少しづつでもなにか作ろうっと。
RubyMotionKaigi 2013 に行ってきた #rubymotionjp
RubyMotionKaigi 2013 に行ってきた。
名前を知ってるだけで、触ったこともないRubyMotionは、どんなものなんだろうと気になっていたので、参加してみた。
基調講演でのLaurentさんの話や、talkでの @watson1978 さん id:naoyaさんの話でおおまかな概要や、現在Webアプリを作ってる立場からのRubyMotionへの取り組み方などの話が聞けてとても良かった。
naoyaさんの話の中で、Vimは黒塗りされていたけれど、Keep your editorなのは、素晴らしいとおもう。XCodeを数年前にちょっとだけ触ってみて、心が折れたのは、editorのキーバインドだったし。
エンタプライズ用途にもつかえるというのが分かったし、Objective-CもCocoaTouchも覚えなきゃいけないよりは、RubyとCocoaTouch でいけるというのは、筋として良さそうに思う。
あと、今週の土曜日までは、RubyKaigi開催記念で15% Discountが行われてるので、いい機会だし、購入して勉強してみようかなと思った。
あと、もくもく会はすぐ埋まるらしいんだけど、RubyMotionKaigi内で他の勉強会が2つは開催されそうなので、タイミングが合えば行ってみたい。
会場提供の mixiさん、speakerの皆さん、主催、運営の皆さん、ありがとうございました!