<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tipset &#187; Ruby/JRuby</title>
	<atom:link href="http://hasumi.info/~h2/tag/rubyjruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://hasumi.info/~h2</link>
	<description>MacやiPhone/iPod Touch関連のTipsを書くハズが発散してるページ</description>
	<lastBuildDate>Wed, 04 Jan 2012 14:23:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LionでRVM</title>
		<link>http://hasumi.info/~h2/2012/01/04/lion%e3%81%a7rvm%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97/</link>
		<comments>http://hasumi.info/~h2/2012/01/04/lion%e3%81%a7rvm%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 13:20:42 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=1769</guid>
		<description><![CDATA[基本的には以前のエントリと同じなので，違うとこだけメモ．

Xcodeのgccがllvmベースになった
LionにアップグレードしたのでXcodeも4.2.1にしたところ，なんとXcode 4からデフォルトコンパイラがG [...]]]></description>
			<content:encoded><![CDATA[<p>基本的には<a href="http://hasumi.info/~h2/2011/01/09/rvm移行/" target="_blank">以前のエントリ</a>と同じなので，違うとこだけメモ．</p>
<ul>
<li>Xcodeのgccがllvmベースになった<br />
LionにアップグレードしたのでXcodeも4.2.1にしたところ，なんとXcode 4からデフォルトコンパイラがGCCからLLVMに変わってた・・・。フロントエンドはClangとllvm-gccが選べるらしいが，一部のgemがLLVMに対応していない？ようで，railsのビルド時にエラー．以前のXcodeの環境が退避されていたので，そっちのgccを使って回避！！以前のXcodeがない場合は，portsとか<a href="https://github.com/adamv/homebrew-alt" target="_blank">homebrew-alt</a>とからいろいろ手はあるハズ.</li>
<li>LionのEditline Libraryは日本語が通る<br />
Snow Leopardまではデフォルトのlibeditで日本語が通らなかったので，GNU readlineを用意する必要があったけど，Lionでは通るので特に不要に．GNU readlineがイイって人はbrewとかから入れればOK.</li>
</ul>
<p>ということで，手順は次の通り．</p>
<ol>
<li>以前のRVMをアンインストール
<pre class="brush: text;">
% rvm implode
</pre>
</li>
<li>RVMをインストール
<pre class="brush: text;">
% bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)
</pre>
</li>
<li>RVMの読み込み<br />
RVMはシェル関数として読み込まれます．<br />
次の一行を.zshrc（bashなら.bashrc）に追加しましょう．<br />
RVM用のPATHが追加されるので，PATHの設定が全部終わっているところに入れること．</p>
<pre class="brush: text;">
 [[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; source &quot;$HOME/.rvm/scripts/rvm&quot;
</pre>
</li>
<li>動作確認<br />
シェルを再起動するなりして設定ファイルを読み込み直したら，次のコマンドを実行してみましょう．</p>
<pre class="brush: text;">
% rvm -v
rvm 1.10.1-pre by Wayne E. Seguin &lt;wayneeseguin@gmail.com&gt;, Michal Papis &lt;mpapis@gmail.com&gt; [https://rvm.beginrescueend.com/]
</pre>
<p>と表示されれば大丈夫でしょう．
</li>
<li>1.9.2-p290と1.8.7-p357のインストール<br />
とりあえず，1.9.2と1.8.7を入れてみましょう．<br />
CCに以前のXcodeのgccを指定してやります．</p>
<pre class="brush: text;">
% CC=/Developer-3.2.1/usr/bin/gcc rvm install 1.9.2
% CC=/Developer-3.2.1/usr/bin/gcc rvm install 1.8.7
</pre>
</li>
<li>デフォルで使うRubyを指定します<br />
デフォルトは1.9.2にしておきましょう</p>
<pre class="brush: text;">
% rvm use --default 1.9.2
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2012/01/04/lion%e3%81%a7rvm%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RVM移行</title>
		<link>http://hasumi.info/~h2/2011/01/09/rvm%e7%a7%bb%e8%a1%8c/</link>
		<comments>http://hasumi.info/~h2/2011/01/09/rvm%e7%a7%bb%e8%a1%8c/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 17:05:25 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=1743</guid>
		<description><![CDATA[最後にエントリ書いてから1年近く放置プレイが続いてますが，皆さんいかがお過ごしでしょうかｗ
ひさびさに環境を整理したのでメモしておきます．
これまで1.8.7はSnow Leopardデフォルトのp174，1.9系はMa [...]]]></description>
			<content:encoded><![CDATA[<p>最後にエントリ書いてから1年近く放置プレイが続いてますが，皆さんいかがお過ごしでしょうかｗ</p>
<p>ひさびさに環境を整理したのでメモしておきます．</p>
<p>これまで1.8.7はSnow Leopardデフォルトのp174，1.9系はMacPorts，JRubyは手動インストール，と使い分けてきましたが，昨年末にRuby 1.8.7-p330がリリースされたし，まとめて<a href="http://rvm.beginrescueend.com/">RVM</a>に移行することにしました．</p>
<p>ちなみに，rvmでRubyをビルドするにはXcode Tools Version 3.2.1 (1613) 以上が必要になるので，入ってない場合は入れときましょう<br />
他にも，</p>
<ul>
<li>If you intend on installing MacRuby you must install LLVM first.</li>
<li>If you intend on installing JRuby you must install the JDK.</li>
<li>If you intend on installing IronRuby you must install Mono (version 2.6 or greater is recommended).</li>
</ul>
<p>だそうですので，必要に応じて適宜入れましょう．</p>
<ol>
<li>Readlineのインストール<br />
MacではReadlineではなく<a href="http://www.thrysoee.dk/editline/">Editline</a>が使われているらしく，デフォルトのままだとirbで日本語が使えません．<br />
入ってない場合は，portでReadlineを入れておきましょう</p>
<pre class="brush: text;">
% sudo port install readline
</pre>
</li>
<li>RVMのインストール<br />
<a href="http://rvm.beginrescueend.com/rvm/install/">公式サイトに書かれている</a>通り，オススメのGitHubからDLしてきます．<br />
RVMはユーザのホームディレクトリ直下に作成される.rvmという名前のディレクトリにインストールされます．<br />
インストール用のスクリプトが用意されているので実行するだけ．</p>
<pre class="brush: text;">
% bash &lt; &lt;( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
</pre>
<p>こんなスクリプト信用ならんｗって人は，下記コマンドを手動でどうぞ</p>
<pre class="brush: text;">
% mkdir -p ~/.rvm/src/ &amp;&amp; cd ~/.rvm/src &amp;&amp; rm -rf ./rvm/ &amp;&amp; git clone --depth 1 git://github.com/wayneeseguin/rvm.git &amp;&amp; cd rvm &amp;&amp; ./install
</pre>
</li>
<li>RVMの読み込み<br />
RVMはシェル関数として読み込まれます．<br />
次の一行を.zshrc（bashなら.bashrc）に追加しましょう．<br />
RVM用のPATHが追加されるので，PATHの設定が全部終わっているところに入れること．</p>
<pre class="brush: text;">
 [[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; source &quot;$HOME/.rvm/scripts/rvm&quot;
</pre>
</li>
<li>動作確認<br />
シェルを再起動するなりして設定ファイルを読み込み直したら，次のコマンドを実行してみましょう．</p>
<pre class="brush: text;">
% rvm -v
rvm 1.2.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
</pre>
<p>と表示されれば大丈夫でしょう．
</li>
<li>1.8.7-p330のインストール
<pre class="brush: text;">
% rvm list known
・・・
[ruby-]1.8.7[-p330]
・・・
</pre>
<p>とかやるとインストールできるものの一覧が表示されますが，とりあえず，1.8.7-p330を入れます．<br />
ここでReadlineのパスを指定してやります．</p>
<pre class="brush: text;">
% rvm install 1.8.7 -C --with-readline-dir=/opt/local
</pre>
</li>
<li>1.9.2-p136のインストール<br />
続いて，1.9.2も入れます．</p>
<pre class="brush: text;">
% rvm list known
・・・
[ruby-]1.9.2[-p136]
・・・
</pre>
<p>によるとp136が入るようです．</p>
<pre class="brush: text;">
% rvm install 1.9.2 -C --with-readline-dir=/opt/local
</pre>
</li>
<li>RVMの設定<br />
インストールしたバージョンを確認してみます．</p>
<pre class="brush: text;">
% rvm list
rvm rubies

   ruby-1.8.7-p330 [ x86_64 ]
   ruby-1.9.2-p136 [ x86_64 ]
</pre>
<p>デフォルトは1.9.2にしておきましょう．</p>
<pre class="brush: text;">
% rvm use --default 1.9.2
Using /Users/h2/.rvm/gems/ruby-1.9.2-p136
</pre>
<p>ちなみにシステムデフォルトのRubyを使いたい時は</p>
<pre class="brush: text;">
% rvm use system
Now using system ruby.
</pre>
<p>でOKです．
</li>
<li>gemの移行<br />
RVMはgemのインポート・エクスポートをサポートしているので，これまで1.8.7-p174で使っていたgemを移行できます．<br />
移行といっても同じ物を入れ直すだけですが・・・</p>
<pre class="brush: text;">
% rvm use system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system
% rm system.gems
</pre>
</li>
</ol>
<p>他にもRVMにはGemSetという便利な機能があるのですが，長くなってきたのでまた次回</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2011/01/09/rvm%e7%a7%bb%e8%a1%8c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby World Conference 2009 2日目</title>
		<link>http://hasumi.info/~h2/2009/09/13/ruby-world-conference-2009-2%e6%97%a5%e7%9b%ae/</link>
		<comments>http://hasumi.info/~h2/2009/09/13/ruby-world-conference-2009-2%e6%97%a5%e7%9b%ae/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 15:02:03 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[ひとりごと]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Rails/Merb]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=1247</guid>
		<description><![CDATA[なんと &#8220;ruby world conference&#8221; でググると公式サイトを差し置いて，このサイトがトップに！？
今は修正？されてますが，びっくりした〜
で，2日目
2日目はTech Day？で [...]]]></description>
			<content:encoded><![CDATA[<p>なんと &#8220;ruby world conference&#8221; でググると公式サイトを差し置いて，このサイトがトップに！？</p>
<p>今は修正？されてますが，びっくりした〜</p>
<p>で，2日目<br />
2日目はTech Day？でテクニカルな話題中心でした</p>
<p>朝はまつもとさんの基調講演「未来へのRuby」<br />
まつもとさんが子供の頃にお父さんから与えられた肥後守を例に，<br />
「人間は信頼されるから伸びる」<br />
「Rubyはユーザを信頼する言語です」<br />
そして某G調査機関によると，他の言語に比べてRubyを愛していると書いているブログ？はかなり多いのだとか<br />
日本語で言うのは恥ずかしいとのことでしたが，「Rubyは愛され言語 (beloved)」「Rubyは愛である」「愛は未来をつくる」 とのこと<br />
本当にいい話でした<br />
あと50年はRubyを作り続けたいとのことなので，当分Rubyは安泰ですね</p>
<p>つづいては，Jeremy Kemperの「Rails3:Convergent evolution」<br />
なんでもRails3 on 1.9はこれまでの3倍以上の高速化が期待できるようでとても楽しみ！！<br />
Railsも結構変化が激しくて，たまにRailsな人にはついてくのが大変なフレームワークだが，着々と進化している<br />
Q&#038;Aで誰かが，「これからもRubyは変わって行くと思うけどなんか言いたいことある？」的な質問をされていたが，「どんどんやればいい，問題があればRailsを修正するだけ」だってｗ<br />
スライドがとても印象的でした〜</p>
<p><a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_1.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_1-150x150.jpg" alt="rwc2009_2_1" title="rwc2009_2_1" width="150" height="150" class="alignnone size-thumbnail wp-image-1254" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_2.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_2-150x150.jpg" alt="rwc2009_2_2" title="rwc2009_2_2" width="150" height="150" class="alignnone size-thumbnail wp-image-1255" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_3.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_3-150x150.jpg" alt="rwc2009_2_3" title="rwc2009_2_3" width="150" height="150" class="alignnone size-thumbnail wp-image-1256" /></a></p>
<p>お昼から<br />
笹田先生が登場するも，なんか時間が30分しかなくて技術的な話はかなり省かれてました・・・<br />
セミコルーチンなんかはバッサリとｗ<br />
それから・・・笹田研にはRuby使いがいないそうで<br />
恐れ多くてなかなかRuby使ってますって言えないんでは？</p>
<p>続いて頃末和義氏によるIronRuby<br />
JRubyはJavaの資産を活用できるというところに存在意義がある気がするけど，IronRubyの存在価値って何なんだろう？<br />
mono上でも動きますとか言われても，monoを使うような環境なら普通にMRIでよくないか？<br />
その辺がもっと聞きたかったなぁ〜<br />
まぁMSとして話せないのかも知れないが・・・</p>
<p>次は，Charles NutterとThomas Enebo<br />
がっ！？ここでトラブル発生！！<br />
プロジェクターにつながらない<br />
結局は変換コネクタが故障していた模様<br />
Macの変換コネクタはどんどんチャチくなって壊れやすくなってる<br />
突然ねこび〜んが登場したり，JRuby on Androidのデモがあったりとてもおもしろかった<br />
以前福岡に来た時にカネウチさんがサインをプレゼントしてたが，Thomasは本当にねこび〜んが好きなようだ<br />
Q&#038;AでJRuby on Androidのリリース日が決まったのは爆笑</p>
<p><a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_4.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_4-150x150.jpg" alt="rwc2009_2_4" title="rwc2009_2_4" width="150" height="150" class="alignnone size-thumbnail wp-image-1257" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_5.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_5-150x150.jpg" alt="rwc2009_2_5" title="rwc2009_2_5" width="150" height="150" class="alignnone size-thumbnail wp-image-1258" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_6.jpg"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/rwc2009_2_6-150x150.jpg" alt="rwc2009_2_6" title="rwc2009_2_6" width="150" height="150" class="alignnone size-thumbnail wp-image-1259" /></a></p>
<p>そしてRubiniusのEvan Phoenix<br />
llvmやJITを利用してって話だったと思います・・・<br />
もっと英語を勉強せんといかんね〜<br />
Ruby on Rubyにチャレンジなんてすごいなぁ</p>
<p>最後はB会場に移動<br />
クックパッドの橋本さん<br />
「ベストなコトをみつけるための３つの輪」<br />
「ユーザの要求に基づいたゴール設計」<br />
「スケジュール決定における3分割の法則」<br />
「ものづくり3原則」<br />
などなど，クックパッドでのサービス企画・開発を中心とした話でした<br />
Ruby的な話は最後の「Railsに乗る」くらいかなぁｗ</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/09/13/ruby-world-conference-2009-2%e6%97%a5%e7%9b%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby World Conference 2009 初日</title>
		<link>http://hasumi.info/~h2/2009/09/11/ruby-world-conference-2009-%e5%88%9d%e6%97%a5/</link>
		<comments>http://hasumi.info/~h2/2009/09/11/ruby-world-conference-2009-%e5%88%9d%e6%97%a5/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 16:24:14 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[ひとりごと]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=1230</guid>
		<description><![CDATA[「一生に一度は島根に行こう！！」というスローガンのもと
Rubyの聖地でRuby World Conferenceが開催されるという 
ということで人生初の松江の地に自分も馳せ参じることに 
今回のお目当てはなんと言って [...]]]></description>
			<content:encoded><![CDATA[<p>「一生に一度は島根に行こう！！」というスローガンのもと<br />
Rubyの聖地でRuby World Conferenceが開催されるという </p>
<p>ということで人生初の松江の地に自分も馳せ参じることに </p>
<p>今回のお目当てはなんと言ってもTim Brayの基調講演</p>
<p>タイトルは &#8220;What is Ruby For?&#8221; でしたが，関数型言語やらパラレル，コンカレンシーなどを踏まえてプログラミング言語の今後の進化，プロフェッショナルであることの意義などなど，非常にバラエティに富んだ内容でした</p>
<p>Ustreamでも配信していたので松江まで行かなくてもよかったのかも知れないが，十分元は取れた</p>
<p>そうそう，Timといえばカウボーイハット！！<br />
でも，郷に入ってはなのか？会議中はお行儀よく帽子を脱いでおられました</p>
<p><a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1812.JPG"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1812-150x150.jpg" alt="IMG_1812" title="IMG_1812" width="150" height="150" class="alignnone size-thumbnail wp-image-1231" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1819.JPG"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1819-150x150.jpg" alt="IMG_1819" title="IMG_1819" width="150" height="150" class="alignnone size-thumbnail wp-image-1232" /></a> <a href="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1818.JPG"><img src="http://hasumi.info/~h2/wp-content/uploads/2009/09/IMG_1818-150x150.jpg" alt="IMG_1818" title="IMG_1818" width="150" height="150" class="alignnone size-thumbnail wp-image-1234" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/09/11/ruby-world-conference-2009-%e5%88%9d%e6%97%a5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merbのインストール</title>
		<link>http://hasumi.info/~h2/2009/06/24/merb%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/</link>
		<comments>http://hasumi.info/~h2/2009/06/24/merb%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 03:51:47 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Rails/Merb]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=830</guid>
		<description><![CDATA[Merbは使ったことなかったんやけど，土曜の勉強会でやるらしいのでインストールしてみた
まずgemを最新にしてから，Merbをインストール

% sudo gem install rubygems-update
% su [...]]]></description>
			<content:encoded><![CDATA[<p>Merbは使ったことなかったんやけど，土曜の勉強会でやるらしいのでインストールしてみた</p>
<p>まずgemを最新にしてから，Merbをインストール</p>
<pre class="brush: text;">
% sudo gem install rubygems-update
% sudo update_rubygems
% sudo gem install merb
</pre>
<p>ここからは，<a href="http://wiki.merbivore.com/howto/gettingstarted/firstapp">チュートリアル</a>を見ながらアプリを作ってみる</p>
<pre class="brush: text;">
% merb-gen app my-first-app
</pre>
<p>次は，リソースの作成（スペースを入れてはいけないので注意）</p>
<pre class="brush: text;">
% merb-gen resource article title:string,content:text
</pre>
<p>なんかdata_objectのgemがないと怒られる</p>
<pre class="brush: text;">
Loading init file from /Volumes/Home/h2/Merb/my-first-app/config/init.rb
Loading /Volumes/Home/h2/Merb/my-first-app/config/environments/development.rb
 ~
 ~ FATAL: The gem data_objects (= 0.9.11, runtime), [] was not found
 ~
</pre>
<p>調べてみると確かにインストールされてるのは，0.9.12だった</p>
<pre class="brush: text;">
% gem search data_objects -l
*** LOCAL GEMS ***
data_objects (0.9.12)
</pre>
<p>ので，config/dependencies.rb の4行目を編集してやる</p>
<pre class="brush: text;">
do_gems_version   = &quot;0.9.11&quot;
=&gt;
do_gems_version   = &quot;0.9.12&quot;
</pre>
<p>再度リソースを作成するとうまくいったので，DBのマイグレート</p>
<pre class="brush: text;">
% rake db:automigrate
</pre>
<p>最後にサーバの起動</p>
<pre class="brush: text;">
% merb &amp;
</pre>
<p>ブラウザで /articles にアクセスして確認<br />
このままだとドキュメントルートにアクセスするとエラーになるのでリダイレクトされるようにしてみる<br />
config/router.rb の最後を変更</p>
<pre class="brush: text;">
match('/').to(:controller =&gt; 'whatever', :action =&gt;'index')
=&gt;
match('/').to(:controller =&gt; 'articles', :action =&gt;'index')
</pre>
<p>変更を保存したらサーバを再起動しなくても反映されているので確認</p>
<p>ってな感じで，ぱっと見た感じでは多少コマンドが違うもののほとんどRailsと同じだった</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/06/24/merb%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Growl4Becky</title>
		<link>http://hasumi.info/~h2/2009/01/24/growl4becky/</link>
		<comments>http://hasumi.info/~h2/2009/01/24/growl4becky/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 18:39:29 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Becky!]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=649</guid>
		<description><![CDATA[言わずと知れた軽量＆高機能メーラーBecky!
10年以上使っているとなかなか他のソフトに乗り換えるのは難しく，Becky!だけのためにVMWare Fusionを買ってWindowsを走らせてます
（まぁ組込み系の開発 [...]]]></description>
			<content:encoded><![CDATA[<p>言わずと知れた軽量＆高機能メーラーBecky!<br />
10年以上使っているとなかなか他のソフトに乗り換えるのは難しく，Becky!だけのためにVMWare Fusionを買ってWindowsを走らせてます<br />
（まぁ組込み系の開発ツールやVMWare Infrastructureの管理ツールとかWindowsがないとどうにもならないことも多いので，助かってるけど・・・）</p>
<p>VMWare Fusionではご存じユニティモード（ParallelsでいうCoherence）が使えるので，WindowsのアプリをまるでMacのアプリのように扱うことができます<br />
バージョン2からはURLの共有という超便利な機能が追加されて，メール内のURLをクリックするとMac側のSafariとかFirefoxで開くことができるようになり，もっとも不満だった点が解消されました</p>
<p>となると残りの大きな不満点は，「新着メールの通知」機能！！</p>
<p>普通のWindows環境ならタスクトレイのアイコンで着信に気づくことができるんですが，ユニティモードでタスクバーを隠しているとメールの着信が分からない・・・</p>
<p>ちょうど先日Beckrbを入れてみたので，Rubyスクリプトで適当にでっち上げてみました</p>
<pre class="brush: ruby;">
require 'ruby-growl'
require 'rbuconv'

class Growl4Becky

	def initialize(ipaddr, pass)
		@g = Growl.new(ipaddr, 'Becky!', ['New Mail Landing'],
			 nil, pass)
	end

	def on_retrieve(message, mail)
		subject = mail.headers.slice(/^Subject: (.*)/, 1)
		from = mail.headers.slice(/^From: (.*)/, 1)
		@g.notify('New Mail Landing', Uconv.sjistou8(from.chomp),
			 Uconv.sjistou8(subject.chomp))
	end

end

# Edit ip address and password
Becky.add_callback Growl4Becky.new('192.168.46.1', 'password')
</pre>
<p>Becky!がメールを受信すると，Growlでお知らせしてくれます</p>
<p><a href="http://hasumi.info/~h2/wp-content/uploads/2009/01/growl4becky.png"><img class="alignnone size-medium wp-image-650" title="growl4becky" src="http://hasumi.info/~h2/wp-content/uploads/2009/01/growl4becky-300x187.png" alt="" width="300" height="187" /></a></p>
<p>使い方ですが，<a title="Beckrb" href="http://hasumi.info/~h2/2009/01/21/beckrb/">Beckrb</a>が必要です<br />
上記のRubyのスクリプトを作成して， scripts\startup フォルダにぶち込んでください<br />
（コピペがめんどいって人は<a href='http://hasumi.info/~h2/wp-content/uploads/2009/01/growl4becky.rb'>コレ</a>を保存してください）</p>
<p>Rubyのライブラリとして<a title="ruby-growl" href="http://rubyforge.org/frs/?group_id=1100">ruby-growl</a>と<a title="rbuconv" href="http://www.yoshidam.net/Ruby_ja.html">rbuconv</a>を使っています<br />
Growlへの通知はUTF-8で行う必要があるのですが，Ruby 1.8.1でUnicodeに変換するのはちょっと面倒です<br />
システムにはできるだけ手を入れたくなかったので，ピュアRuby版Uconvのrbuconvを使いました<br />
なので，これらのライブラリをDLして，Beckrbの lib\ruby\1.8 フォルダの中にぶち込んでください</p>
<p>あと，ネットワーク通知を使うので「システム環境設定」の「Growl」で「リモートアプリケーション登録を許可」しておく必要があります<br />
パスワードも設定しておいた方がよいでしょう</p>
<p>あとは，スクリプトの最終行のIPアドレスと，パスワードを適宜変更するだけです</p>
<p>Becky!を再起動するとGrowlに登録されるので，お好みに応じて「システム環境設定」の「Growl」でBecky!からの通知に対して，表示スタイルやスティッキーなどを変更できます</p>
<p>VMware FusionとかParallelsを使ってて不便やなぁ・・・と思ってる方はぜひお試しください</p>
<p>＃IMAPでの受信はうまく通知されません（Becky! APIの仕様と思われます）</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/01/24/growl4becky/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beckrb</title>
		<link>http://hasumi.info/~h2/2009/01/21/beckrb/</link>
		<comments>http://hasumi.info/~h2/2009/01/21/beckrb/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 18:51:52 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Becky!]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=644</guid>
		<description><![CDATA[RubyでBecky!の機能を拡張することができるラッパープラグインBeckrb
先日たまたま見つけたが，もっと早く知ってれば・・・
ただRubyのバージョンは1.8.1
Unicodeの扱いなどを考えると1.8.2の壁 [...]]]></description>
			<content:encoded><![CDATA[<p>RubyでBecky!の機能を拡張することができるラッパープラグイン<a title="Beckrb" href="http://www.tietew.jp/pages/archive">Beckrb</a></p>
<p>先日たまたま見つけたが，もっと早く知ってれば・・・</p>
<p>ただRubyのバージョンは1.8.1</p>
<p>Unicodeの扱いなどを考えると1.8.2の壁は小さくないが，残念ながら最後の更新が2004年の5月なのでもうメンテナンスされていないみたい</p>
<p>とりあえずインストール方法をまとめておく</p>
<p>まず次の3点をダウンロード</p>
<ul>
<li>Beckrb本体 <a title="beckrb-0.9.7.zip" href="http://ftp.tietew.jp/pub/becky/beckrb/beckrb-0.9.7.zip">beckrb-0.9.7.zip</a></li>
<li>Beckrb用Ruby <a title="ruby-1.8.1-20040218_vc71.zip" href="http://ftp.tietew.jp/pub/becky/beckrb/ruby-1.8.1-20040218_vc71.zip">ruby-1.8.1-20040218_vc71.zip</a></li>
<li>VC++.NET 2003のランタイム <a title="msvcr71.zip" href="http://ftp.tietew.jp/pub/becky/beckrb/msvcr71.zip">msvcr71.zip</a>（インストール済みの人は不要）</li>
</ul>
<p>Beckrbのインストール先は，</p>
<ul>
<li>全ユーザ共有のインストールディレクトリ</li>
<li>各ユーザ専用のデータフォルダ</li>
</ul>
<p>のどちらかを選ぶことができる</p>
<p>データフォルダさえ移せば簡単に環境が移せるのもBecky!のよいところなので，今回はデータフォルダにインストール</p>
<ol>
<li>beckrb-0.9.7.zip を展開して beckrb.dll（プラグインローダ） と bekrb.so（プラグイン本体） を Plugins フォルダにコピーする</li>
<li>ruby-1.8.1-20040218_vc71.zip を展開して msvcrt-ruby18.dll（Rubyインタプリンタ） と lib フォルダ（Rubyライブラリ）をデータフォルダ直下にコピー</li>
<li>msvcr71.zip を展開して msvcp71.dll（VC++ランタイムライブラリ） と msvcr71.dll（VC++ランタイムライブラリ） をデータフォルダ直下にコピー（システムディレクトリ C:\Windows\System32 などに置くのもアリ）</li>
<li>Becky!を再起動してプラグインを組込む</li>
</ol>
<p>メニューに「スクリプト」という項目が増えていれば成功</p>
<p>Beckrbは起動時に，インストールフォルダ直下の scripts/startup/*.rb，データフォルダ直下の scripts/startup/*.rb を順に実行するので，コールバックを利用するスクリプトはココに置いておく</p>
<p>とりあえず前から作ろうと思っていたプラグインを作ってみた</p>
<p>ソースも公開されているので最新版のRubyに対応させてみるのもおもしろいかもしれない</p>
<p>なんかJava版の<a title="BkJava" href="http://d.hatena.ne.jp/bkjava/">BkJava</a>というものもあるみたい</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/01/21/beckrb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>winmail.datがウザい件</title>
		<link>http://hasumi.info/~h2/2009/01/15/winmaildat%e3%81%8c%e3%82%a6%e3%82%b6%e3%81%84%e4%bb%b6/</link>
		<comments>http://hasumi.info/~h2/2009/01/15/winmaildat%e3%81%8c%e3%82%a6%e3%82%b6%e3%81%84%e4%bb%b6/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 19:33:04 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=639</guid>
		<description><![CDATA[Outlook 2007（X-Mailer: Microsoft Office Outlook 12.0）とかを使っている人から，winmail.datとかいう謎の添付ファイルがついたファイルが届きませんか？
winma [...]]]></description>
			<content:encoded><![CDATA[<p>Outlook 2007（X-Mailer: Microsoft Office Outlook 12.0）とかを使っている人から，winmail.datとかいう謎の添付ファイルがついたファイルが届きませんか？</p>
<p>winmail.datはMicrosoftの独自仕様のリッチテキストデータですが，メールはMIMEマルチパート形式になっていてプレインテキストもついてくるので何とか中身を読むことは可能です</p>
<p>ただ，添付ファイルがwinmail.datにまとめられてしまって，Outlook以外のメーラーでは開けないというクソ仕様です<br />
しかもデフォルトでそういう設定になっている？ようで，HTMLメールの数倍ウザい存在です</p>
<p>Winowsではfentun.exe，Macだと<a title="TNEF's Enough" href="http://www.joshjacob.com/macdev/tnef/index.html">TNEF&#8217;s Enough</a>などの解凍ツールが有名ですが，ファイル名に漢字などのマルチバイト文字が含まれているとうまく解凍できないようです<br />
これまでだとここであきらめて送り直してもらっていたのですが，筑波大学の新城氏が書かれた<a title="winmail.rb" href="http://groups.google.co.jp/group/fj.sources/browse_thread/thread/58bfebe6593fd085">winmail.rb</a>というスクリプトを見つけました<br />
このスクリプトは漢字OKで，先頭の設定を適当に修正することで，EUCな環境にも対応できるとのことです<br />
RubyなのでOSを選ばないのもGood</p>
<p>winmail.rbは<a title="Ruby TNEF library" href="http://raa.ruby-lang.org/project/tnef/">Ruby TNEF library</a>を使用します<br />
ダウンロードしてきて適当な場所において，winmail.rbのrequire文を適宜修正すればOKなのですが，29Jan2004版では下記のような警告がでます</p>
<pre class="brush: text;">
/Volumes/Home/h2/bin/tnef.rb:498: warning: parenthesize argument(s) for future version
/Volumes/Home/h2/bin/tnef.rb:574: warning: parenthesize argument(s) for future version
/Volumes/Home/h2/bin/tnef.rb:575: warning: parenthesize argument(s) for future version
/Volumes/Home/h2/bin/tnef.rb:576: warning: parenthesize argument(s) for future version
/Volumes/Home/h2/bin/tnef.rb:579: warning: don't put space before argument parentheses
</pre>
<p>要するに括弧を付けておいたほうがよいとかスペースを入れるなって話なので，修正しておきましょう</p>
<pre class="brush: text;">
498c498
&lt; debug sprintf '## Unknown attribute name %4.4x',attribute.name
---
&gt; debug sprintf('## Unknown attribute name %4.4x',attribute.name)
574,576c574,576
&lt; debug sprintf '## Unknown MAPI type 0x%4.4x',attr_type
&lt; debug sprintf &quot;attr_type: 0x%4.4x&quot;,attr_type
&lt; debug sprintf &quot;attr_name: 0x%4.4x&quot;,attr_name
---
&gt; debug sprintf('## Unknown MAPI type 0x%4.4x',attr_type)
&gt; debug sprintf(&quot;attr_type: 0x%4.4x&quot;,attr_type)
&gt; debug sprintf(&quot;attr_name: 0x%4.4x&quot;,attr_name)
579c579
&lt; attr = TNEFMAPI_Attribute.new ( attr_type, attr_name, attr_data)
---
&gt; attr = TNEFMAPI_Attribute.new( attr_type, attr_name, attr_data)
</pre>
<p>パスの通った場所において，<code>chmod a+x</code>とかしとけば，</p>
<pre class="brush: text;">
$ winmail.rb winmail.dat ls
$ winmail.rb winmail.dat extract
</pre>
<p>するだけでOKです</p>
<p>TNEFなんてさっさと消えてくれればいいんですが・・・</p>
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2009/01/15/winmaildat%e3%81%8c%e3%82%a6%e3%82%b6%e3%81%84%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing on JRuby</title>
		<link>http://hasumi.info/~h2/2008/09/29/processing-on-jruby/</link>
		<comments>http://hasumi.info/~h2/2008/09/29/processing-on-jruby/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 18:26:15 +0000</pubDate>
		<dc:creator>p0n</dc:creator>
				<category><![CDATA[PC]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://hasumi.info/~h2/?p=144</guid>
		<description><![CDATA[先日行われたRBC (Ruby Business Commons) の勉強会に行ってきました

テーマはProcessing on JRuby


ProcessingはMITで開発されている言語で，FLASHのようなビ [...]]]></description>
			<content:encoded><![CDATA[<p>先日行われた<a href="http://rubybizcommons.blogspot.com/">RBC (Ruby Business Commons)</a> の勉強会に行ってきました</p>
<p>
テーマはProcessing on JRuby
</p>
<p>
<a href="http://processing.org/">Processing</a>はMITで開発されている言語で，FLASHのようなビジュアルコンテンツを作ったり，インタラクティブなコンテンツ作りに向いている言語です<br />
ちょっと調べたところ，カメラやマイクなどの外部機器と連携した大がかりなアートなども作られているみたいです
</p>
<p>
取っつきやすいので，プログラマ以外のデザイナーさんとかでも使えそうです<br />
Javaベースなこともあって，個人的にはActionScriptよりもずっと馴染みやすい<br />
勉強会ではJRubyを使うことで，よりカンタンにProcessingを使うことができました
</p>
<p>
以下は勉強会で作ったコンテンツの一部です
</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/q-rODPjDl7A&amp;hl=ja&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/q-rODPjDl7A&amp;hl=ja&amp;fs=1" allowfullscreen="true"></embed></object></p>
<p>マウスの動きに反応するインタラクティブアートもOK</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/cjuEMl0rmBE&amp;hl=ja&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/cjuEMl0rmBE&amp;hl=ja&amp;fs=1" allowfullscreen="true"></embed></object></p>
<p>残念ながら自分にはアートの才能はありませんが，デモとかのコンテンツ作りに使えそう<br />
楽しい言語なので是非チャレンジしてみてください ！！
</p>
<p>
最後になりましたが，スタッフの皆さん，ありがとうございました<br />
]]></content:encoded>
			<wfw:commentRss>http://hasumi.info/~h2/2008/09/29/processing-on-jruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

