<?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>ダオカオス☆D流のライフスタイル &#187; rails</title>
	<atom:link href="http://www.daokaous.com/category/computer/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daokaous.com</link>
	<description></description>
	<lastBuildDate>Sun, 29 Aug 2010 15:29:28 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Rubyで仕事している人ならWEB+DB PRESS Vol.58は買っておくべきかも</title>
		<link>http://www.daokaous.com/2010/08/web_db58/</link>
		<comments>http://www.daokaous.com/2010/08/web_db58/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 13:01:40 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[コンピュータ]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=706</guid>
		<description><![CDATA[
			
				
			
		
 photo credit: daz smith
いまさら知ったのですが、Fujisan.co.jpで定期購読すると、WEB+DB PRESSが発売日前に届くようです。
そんなわけで、書 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F08%2Fweb_db58%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F08%2Fweb_db58%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/24441843@N00/4907742042/" title="docks7" target="_blank"><img src="http://farm5.static.flickr.com/4077/4907742042_f382d1c0c0_t.jpg" alt="docks7" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Attribution-ShareAlike License" target="_blank"><img src="http://www.daokaous.com/wordpress/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/24441843@N00/4907742042/" title="daz smith" target="_blank">daz smith</a></small><br />
いまさら知ったのですが、<a href="http://www.fujisan.co.jp/Product/1281680264">Fujisan.co.jp</a>で定期購読すると、WEB+DB PRESSが発売日前に届くようです。</p>
<p>そんなわけで、書店で並ぶより一足先に手元に届いたのでさっと読んでみました。</p>
<p>全部読んだわけではないのですが、Ruby on Railsで仕事している人なら買って損はないと思います。</p>
<p>特集がRails3でruby連載で1.9.2が取り上げられているという、Ruby on Railsを今後もやっていく人なら必ず触れていくだろうものがうまい具合に載っています！<br />
まだあまりよく読んでないのですが、CassandraでもRuby on Railsへの組み込み方がトピックにあったり、Rail3で対応されたHTML5の特集があったりとRuby on Railsで仕事をしている人にとってはまさに神号ですね。</p>
<p>Rails3特集は本当によくまとまっており、Rails3を使っていく上での道しるべとなりそうです。<br />
特に第4章のコアライブラリの新機能・変更点はRails2から3へシフトする上で本当にありがたいです。<br />
ここら辺はこれを足がかりに自分でもまとめたいくらいです。</p>
<p>ここ最近、iPhoneアプリ開発がメインでRailsをあまり触ってなかったのですが、これを機にRails3とruby1.9.2を触れていきたいなぁと思います。本当はiPadの方も調べないといけないのに欲深くて困ってしまいますｗ</p>
<p>個人的には、これから徐々に、しかしあっという間に開発のパラダイムシフトが起きていきそうな気がします。</p>
<p>ruby1.8系からruby1.9系<br />
rails2.3系からrails3系<br />
SubversionからGit<br />
RDBMSからNoSQL<br />
HTML5/CSS3<br />
etc&#8230;</p>
<p>本当にもたもたしていたら置いていかれそうですし、すでに置いていかれているような危機感すらを感じます。。<br />
ただ、後手後手になる前に何かすら前に進んでおきたい。</p>
<p>そんな意気込みでがんばって行こうと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2010/08/web_db58/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails3.0のAPIドキュメントを作ってみました。</title>
		<link>http://www.daokaous.com/2010/02/rails3-0%e3%81%aeapi%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82/</link>
		<comments>http://www.daokaous.com/2010/02/rails3-0%e3%81%aeapi%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 11:44:19 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Document]]></category>
		<category><![CDATA[rails3.0]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=552</guid>
		<description><![CDATA[
			
				
			
		
昨日、Rails3.0のベータ版がリリースされました。
早速入れて試してみようとしたのですが、gemインストールしただけではなぜかRDocが生成されいない。。
というわけで、自分でRDo [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F02%2Frails3-0%25e3%2581%25aeapi%25e3%2583%2589%25e3%2582%25ad%25e3%2583%25a5%25e3%2583%25a1%25e3%2583%25b3%25e3%2583%2588%25e3%2582%2592%25e4%25bd%259c%25e3%2581%25a3%25e3%2581%25a6%25e3%2581%25bf%25e3%2581%25be%25e3%2581%2597%25e3%2581%259f%25e3%2580%2582%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F02%2Frails3-0%25e3%2581%25aeapi%25e3%2583%2589%25e3%2582%25ad%25e3%2583%25a5%25e3%2583%25a1%25e3%2583%25b3%25e3%2583%2588%25e3%2582%2592%25e4%25bd%259c%25e3%2581%25a3%25e3%2581%25a6%25e3%2581%25bf%25e3%2581%25be%25e3%2581%2597%25e3%2581%259f%25e3%2580%2582%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>昨日、Rails3.0のベータ版がリリースされました。<br />
早速入れて試してみようとしたのですが、gemインストールしただけではなぜかRDocが生成されいない。。</p>
<p>というわけで、自分でRDocを生成してみました。<br />
「<a href="http://www.func09.com/wordpress/archives/505">スマートな検索ができるRDocを自分のプロジェクトでも使う方法</a>」という記事をを参考にして、railsapi.comぽくしてみました。<br />
せっかくなので以下のURLにおいてみたので、ご自由に参照してください。</p>
<p>Rails3.0.0.beta Documentation<br />
<a href="http://www.daokaous.com/rails3.0.0_doc/">http://www.daokaous.com/rails3.0.0_doc/</a></p>
<p>※RDocは以下のパッケージについて生成しています。(バージョンはすべて3.0.0.beta)</p>
<ul>
<li>actionmailer</li>
<li>actionpack</li>
<li>activemodel</li>
<li>activerecord</li>
<li>activeresource</li>
<li>activesupport</li>
<li>railties</li>
</ul>
<p>※基本的に機械的に生成したのでリンク切れが生じている箇所がありますが、ご了承ください。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2010/02/rails3-0%e3%81%aeapi%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntuでrails環境構築～ubuntu9.10改訂版～</title>
		<link>http://www.daokaous.com/2010/01/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9eubuntu9-10%e6%94%b9%e8%a8%82%e7%89%88%ef%bd%9e/</link>
		<comments>http://www.daokaous.com/2010/01/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9eubuntu9-10%e6%94%b9%e8%a8%82%e7%89%88%ef%bd%9e/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 14:54:26 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[環境構築]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=527</guid>
		<description><![CDATA[
			
				
			
		
去年4月に書いたubuntuでrails環境構築は、予想外の反響を頂き、いまだにこのブログのアクセスする人の2割がこの記事目当てにきているみたいです。
しかし、この記事を書いてから9ヶ月 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F01%2Fubuntu%25e3%2581%25a7rails%25e7%2592%25b0%25e5%25a2%2583%25e6%25a7%258b%25e7%25af%2589%25ef%25bd%259eubuntu9-10%25e6%2594%25b9%25e8%25a8%2582%25e7%2589%2588%25ef%25bd%259e%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2010%2F01%2Fubuntu%25e3%2581%25a7rails%25e7%2592%25b0%25e5%25a2%2583%25e6%25a7%258b%25e7%25af%2589%25ef%25bd%259eubuntu9-10%25e6%2594%25b9%25e8%25a8%2582%25e7%2589%2588%25ef%25bd%259e%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>去年4月に書いた<a href="http://www.daokaous.com/2009/04/ubuntuでrails環境構築/">ubuntuでrails環境構築</a>は、予想外の反響を頂き、いまだにこのブログのアクセスする人の2割がこの記事目当てにきているみたいです。</p>
<p>しかし、この記事を書いてから9ヶ月たちubuntuのバージョンも2つ上がって、最新のubuntuではパッケージがなくなったりしてうまくいかないところがちらほら出てきたので、改めて<strong>ubuntu9.10用</strong>に書き直してみました。</p>
<p>今回も基本的にパッケージからインストールするようにして、さくっと開発環境を作る方向で書いています。</p>
<h4>今回の検証環境</h4>
<p>ubuntu9.10(server版)<br />
windowsXP上のVMWareで動作</p>
<h4>今回インストールしたもの(主なもの)</h4>
<ul>
<li>paco 2.0.7</li>
<li>ruby 1.8.7</li>
<li>rubygems 1.3.5</li>
<li>rails 2.3.5</li>
<li>SQLite 3.6.16</li>
<li>MySQL 5.1.37</li>
<li>PostgreSQL 8.4.2</li>
<li>vim 7.2.245</li>
</ul>
<h4>下準備</h4>
<h5>make, g++ のインストール</h5>
<p>インストールしたばかりのubuntuにはmakeもg++もないので真っ先にインストール</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential</pre></div></div>

<h5>pacoのインストール</h5>
<p>ソースからインストールしたソフトをパッケージ管理してくれるありがたいソフト！<br />
今回はソースからインストールしたものはgemだけだが、後々のことを考えて先にインストールしておく。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>paco<span style="color: #000000; font-weight: bold;">/</span>paco-2.0.7.tar.gz
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf paco-2.0.7.tar.gz
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> paco-2.0.7
&nbsp;
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--disable-gpaco</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h6>使用例</h6>
<p>インストール時にpacoをかませるとパッケージ管理してくれる。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-D</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>-Dオプションでディレクトリ名がパッケージ名になる<br />
-pオプションで自分の指定した名前でパッケージ名を登録することが可能</p>
<p>pacoに登録してあるパッケージの確認は↓</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">paco <span style="color: #660033;">-a</span></pre></div></div>

<p>アンインストールするときは下の1行をたたけばOK</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-r</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>削除するパッケージ名<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<h5>ruby1.8.7のインストール</h5>
<p>今まで、rubyをインストールする時に必要な関連パッケージの指定が煩わしかったが、ubuntu9.10になってruby-fullというパッケージがでて、これ1つで基本的に必要なものはインストールされるようになった。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby-full</pre></div></div>

<p>ruby-fullでインストールすると、以下のパッケージがインストールされるようになる。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defoma emacs emacs22-bin-common emacs22-common emacs22-gtk emacsen-common fontconfig
  fontconfig-config hicolor-icon-theme irb irb1.8 libasound2 libatk1.0-<span style="color: #000000;">0</span> libatk1.0-data
  libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcups2 libdatrie1
  libdbm-ruby libdbm-ruby1.8 libdirectfb-<span style="color: #000000;">1.2</span>-<span style="color: #000000;">0</span> libdrm-intel1 libdrm-radeon1 libdrm2
  libfontconfig1 libfontenc1 libgdbm-ruby libgdbm-ruby1.8 libgif4 libgl1-mesa-dri
  libgl1-mesa-glx libgtk2.0-<span style="color: #000000;">0</span> libgtk2.0-bin libgtk2.0-common libice6 libjasper1 libjpeg62
  libopenssl-ruby libopenssl-ruby1.8 libpango1.0-<span style="color: #000000;">0</span> libpango1.0-common libpixman-<span style="color: #000000;">1</span>-<span style="color: #000000;">0</span>
  libpng12-<span style="color: #000000;">0</span> libreadline-ruby libreadline-ruby1.8 libruby1.8 libsm6 libsysfs2 libtcltk-ruby
  libtcltk-ruby1.8 libthai-data libthai0 libtiff4 libts-<span style="color: #000000;">0.0</span>-<span style="color: #000000;">0</span> libxaw7 libxcb-render-util0
  libxcb-render0 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1 libxft2 libxi6
  libxinerama1 libxmu6 libxpm4 libxrandr2 libxrender1 libxt6 libxtst6 libxv1 libxxf86dga1
  libxxf86vm1 rdoc rdoc1.8 ri ri1.8 ruby ruby-elisp ruby-full ruby1.8 ruby1.8-dev
  ruby1.8-elisp tcl8.4 tk8.4 tsconf ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
  x-ttcidfont-conf x11-utils xbitmaps xfonts-encodings xfonts-utils xterm</pre></div></div>

<p>自分はemacs使いじゃないし、勝手に入るのは困るという人は今までどおり、1つ1つ必要なパッケージをしていく方法でもOK。基本的に以下のパッケージがあればrails開発は十分</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> irb libopenssl-ruby libreadline-ruby libruby rdoc ri ruby ruby1.8-dev</pre></div></div>

<h4>rubygemsのインストール</h4>
<p>rubyのパッケージ管理ソフト。railsのインストールなどに使用。<br />
2010/1/16現在、ソースから入れても、パッケージから入れてもともに最新1.3.5がインストールされるが、バージョンが上がったりした時に素早く対応しておきたいので、rubygemsついてはソースから入れることにする。<br />
※ものによっては最新のrubygemsを要求するものがあるため</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">60718</span><span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.5.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf rubygems-1.3.5
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-1.3.5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-D</span> ruby setup.rb</pre></div></div>

<h4>railsのインストール</h4>
<p>gemでインストール。特にバージョンを指定しない場合、最新のものが入る。<br />
(2010/1/16に現在 2.3.5)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

<p>バージョンをしてする場合は、-vオプションを使う。他のgemsで入れるパッケージについても同様</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails <span style="color: #660033;">-v</span>=バージョン</pre></div></div>

<h4>SQLite3でrails</h4>
<p>2系からrailsデフォルトになったDB。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite3 libsqlite3-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite3-ruby</pre></div></div>

<h4>MySQLでrails</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server libmysqlclient16-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>※ubuntu9.10ではインストール時にmysqlのrootのパスワードを設定するようになった。</p>
<h4>postgresでrails</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql-<span style="color: #000000;">8.4</span> postgresql-server-dev-<span style="color: #000000;">8.4</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> pg</pre></div></div>

<h5>Postgresでの注意点</h5>
<p>インストール直後はpostgresユーザでしかコンソールにログインできない。<br />
postgresのUNIXソケットのデフォルトの設定でそうなっている。<br />
ポリシーとか、セキュリティを気にしないなら、<br />
<strong>/etc/postgresql/8.4/main/pg_hba.conf</strong>を以下のように編集</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>81
82
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Database administrative login by UNIX sockets</span>
<span style="color: #7a0874; font-weight: bold;">local</span>   all         all                          trust</pre></td></tr></table></div>

<p>変更後、postgresの再起動を忘れずに</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>postgres restart</pre></div></div>

<h4>vimでrails開発しやすくする</h4>
<p>デフォルトで入っているvimではrubyのオムニ補完ができないなど貧弱なので、<br />
rubyに対応したvimをインストールする</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> vim-nox
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> vim-ruby
vim-ruby-install.rb</pre></div></div>

<p>railsをやるなら<a href="http://www.vim.org/scripts/script.php?script_id=1567">rails.vim</a>は必ず入れた方がいいです。</p>
<p>こまかいvimの設定やプラグインについてはナレッジエースの<a href="http://blog.blueblack.net/item_133">Vimを使ったRuby On Rails開発環境の構築</a>などを参考にするといいです。</p>
<h5>ubuntu9.10でパッケージからvimを入れるときの注意</h5>
<p>ubuntu9.10になって、vimのパッケージまわりがちらほら変わっているので要注意。<br />
vim-fullがなくなり、その関係でvim-railsが使えなくなったりしています。<br />
他のサイトでvimの環境構築や設定を調べる場合は注意したほうがいいです。</p>
<p>ここまでくれば、最低限のrails開発環境は整うはずです。<br />
ここから先は、自分の開発スタイルなどに合わせて、適宜必要なもの追加したり、設定したりしてください。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2010/01/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9eubuntu9-10%e6%94%b9%e8%a8%82%e7%89%88%ef%bd%9e/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rmagick導入メモ ubuntu9.10編</title>
		<link>http://www.daokaous.com/2009/10/rmagick%e5%b0%8e%e5%85%a5%e3%83%a1%e3%83%a2-ubuntu9-10%e7%b7%a8/</link>
		<comments>http://www.daokaous.com/2009/10/rmagick%e5%b0%8e%e5%85%a5%e3%83%a1%e3%83%a2-ubuntu9-10%e7%b7%a8/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 06:34:37 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[コンピュータ]]></category>
		<category><![CDATA[環境構築]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu9.10]]></category>
		<category><![CDATA[インストール手順]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=426</guid>
		<description><![CDATA[
			
				
			
		
なんかいつもいつも忘れるのでメモ。
ubuntuでImageMagickをapt-getでインストールして、rubygemsでインストールする時の手順

sudo apt-get ins [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F10%2Frmagick%25e5%25b0%258e%25e5%2585%25a5%25e3%2583%25a1%25e3%2583%25a2-ubuntu9-10%25e7%25b7%25a8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F10%2Frmagick%25e5%25b0%258e%25e5%2585%25a5%25e3%2583%25a1%25e3%2583%25a2-ubuntu9-10%25e7%25b7%25a8%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>なんかいつもいつも忘れるのでメモ。<br />
ubuntuでImageMagickをapt-getでインストールして、rubygemsでインストールする時の手順</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> imagemagick libmagick++<span style="color: #000000;">9</span>-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick</pre></div></div>

<p>たったこれだけですが、なんか忘れてハマってしまうことがある。。。</p>
<p>なんで「<a href="http://www.daokaous.com/2009/04/ubuntu%E3%81%A7rails%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89/">ubuntuでrails環境構築</a>」でこれ書くの忘れていたんだろう。。。</p>
<p>上の内容もubuntu9.10になって、微妙に内容が変わっているところが出てきたので近いうちに9.10用に書き直したいと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2009/10/rmagick%e5%b0%8e%e5%85%a5%e3%83%a1%e3%83%a2-ubuntu9-10%e7%b7%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>タグをサニタイズする</title>
		<link>http://www.daokaous.com/2009/05/%e3%82%bf%e3%82%b0%e3%82%92%e3%82%b5%e3%83%8b%e3%82%bf%e3%82%a4%e3%82%ba%e3%81%99%e3%82%8b/</link>
		<comments>http://www.daokaous.com/2009/05/%e3%82%bf%e3%82%b0%e3%82%92%e3%82%b5%e3%83%8b%e3%82%bf%e3%82%a4%e3%82%ba%e3%81%99%e3%82%8b/#comments</comments>
		<pubDate>Mon, 18 May 2009 14:42:02 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[メモ]]></category>
		<category><![CDATA[小技]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=252</guid>
		<description><![CDATA[
			
				
			
		
railsでブログや掲示板みたいなものを作ろうとすると、入力でタグの利用を許可したい場合が出てきますが、さりとてむやみに許可するとXSSの温床になってしまいます。。。
そんなわけで、使え [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F05%2F%25e3%2582%25bf%25e3%2582%25b0%25e3%2582%2592%25e3%2582%25b5%25e3%2583%258b%25e3%2582%25bf%25e3%2582%25a4%25e3%2582%25ba%25e3%2581%2599%25e3%2582%258b%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F05%2F%25e3%2582%25bf%25e3%2582%25b0%25e3%2582%2592%25e3%2582%25b5%25e3%2583%258b%25e3%2582%25bf%25e3%2582%25a4%25e3%2582%25ba%25e3%2581%2599%25e3%2582%258b%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>railsでブログや掲示板みたいなものを作ろうとすると、入力でタグの利用を許可したい場合が出てきますが、さりとてむやみに許可するとXSSの温床になってしまいます。。。</p>
<p>そんなわけで、使えるタグや属性を指定し、それ以外のタグや属性は許可しないようにしたいわけですが、railsにはそれを自動でやってくれる<strong>sanitize</strong>という便利なメソッドがあることを最近知りました。</p>
<h5>使い方</h5>
<p>hメソッドと一緒で、サニタイズしたい文字列変数の前に<strong>sanitize</strong>とつける</p>
<h5>（例示すほどでもないですが）</h5>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">sanitize hoge</pre></div></div>

<h5>デフォルトで使用できるタグ</h5>
<p>sanitizeメソッドで使えるタグを知りたいときは script/console で <strong>ActionView::Base.sanitized_allowed_tags.sort</strong> と入力してみると知ることができます。同じように使用できる属性地を知りたい場合は、　<strong>ActionView::Base.sanitized_allowed_attributes.sort</strong> と入力すると調べられます。</p>
<p>ちなみにrails2.3.2の場合、使用できるタグ、属性はこんな感じになっています。</p>
<h6>使用できるタグ</h6>
<blockquote><p>
&#8220;a&#8221;, &#8220;abbr&#8221;, &#8220;acronym&#8221;, &#8220;address&#8221;, &#8220;b&#8221;, &#8220;big&#8221;, &#8220;blockquote&#8221;, &#8220;br&#8221;, &#8220;cite&#8221;, &#8220;code&#8221;, &#8220;dd&#8221;, &#8220;del&#8221;, &#8220;dfn&#8221;, &#8220;div&#8221;, &#8220;dt&#8221;, &#8220;em&#8221;, &#8220;h1&#8243;, &#8220;h2&#8243;, &#8220;h3&#8243;, &#8220;h4&#8243;, &#8220;h5&#8243;, &#8220;h6&#8243;, &#8220;hr&#8221;, &#8220;i&#8221;, &#8220;img&#8221;, &#8220;ins&#8221;, &#8220;kbd&#8221;, &#8220;li&#8221;, &#8220;ol&#8221;, &#8220;p&#8221;, &#8220;pre&#8221;, &#8220;samp&#8221;, &#8220;small&#8221;, &#8220;span&#8221;, &#8220;strong&#8221;, &#8220;sub&#8221;, &#8220;sup&#8221;, &#8220;tt&#8221;, &#8220;ul&#8221;, &#8220;var&#8221;
</p></blockquote>
<h6>使用できる属性</h6>
<blockquote><p>
&#8220;abbr&#8221;, &#8220;alt&#8221;, &#8220;cite&#8221;, &#8220;class&#8221;, &#8220;datetime&#8221;, &#8220;height&#8221;, &#8220;href&#8221;, &#8220;name&#8221;, &#8220;src&#8221;, &#8220;title&#8221;, &#8220;width&#8221;, &#8220;xml:lang&#8221;
</p></blockquote>
<h5>使用できるタグを追加する</h5>
<p>environmetsに↓のように使用したいタグ・属性を追加すればOK</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">config.<span style="color:#9900CC;">action_view</span>.<span style="color:#9900CC;">sanitized_allowed_tags</span> = 使用したいタグ<span style="color:#006666;">1</span>, 使用したいタグ２,・・・
config.<span style="color:#9900CC;">action_view</span>.<span style="color:#9900CC;">sanitized_allowed_attributes</span> = 使用した属性値<span style="color:#006666;">1</span>, 使用したい属性値,・・・</pre></div></div>

<p>こんな便利なのになんで気がつかなかったんだろう。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2009/05/%e3%82%bf%e3%82%b0%e3%82%92%e3%82%b5%e3%83%8b%e3%82%bf%e3%82%a4%e3%82%ba%e3%81%99%e3%82%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntuでrails環境構築</title>
		<link>http://www.daokaous.com/2009/04/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89/</link>
		<comments>http://www.daokaous.com/2009/04/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 14:22:13 +0000</pubDate>
		<dc:creator>daoka</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[コンピュータ]]></category>
		<category><![CDATA[環境構築]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[サーバ]]></category>
		<category><![CDATA[開発]]></category>

		<guid isPermaLink="false">http://www.daokaous.com/?p=76</guid>
		<description><![CDATA[
			
				
			
		
※ubuntu9.10用に記事を新たに記事を書きました。※
ubuntu9.10で環境構築する方はubuntuでrails環境構築～ubuntu9.10改訂版～を参考にしてください。
最 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F04%2Fubuntu%25e3%2581%25a7rails%25e7%2592%25b0%25e5%25a2%2583%25e6%25a7%258b%25e7%25af%2589%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.daokaous.com%2F2009%2F04%2Fubuntu%25e3%2581%25a7rails%25e7%2592%25b0%25e5%25a2%2583%25e6%25a7%258b%25e7%25af%2589%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><span style="color:#FF0000">※ubuntu9.10用に記事を新たに記事を書きました。※</span><br />
ubuntu9.10で環境構築する方は<a href="http://www.daokaous.com/2010/01/ubuntuでrails環境構築～ubuntu9-10改訂版～/"><strong>ubuntuでrails環境構築～ubuntu9.10改訂版～</strong></a>を参考にしてください。</p>
<p>最近、windowsでrails開発をするメリットを感じないどころか、ちょっとしたストレスになりつつ。。。<br />
そんなわけで、スペックもてあましまくりのCorei7マシーンにVMWare Serverをインストールして、その上にubuntuをインストールしてrails環境を立ててみました。</p>
<p>基本的に、aptでパッケージインストールしましたが、それでも依存パッケージの絡みではまったりしまったり^^;<br />
そんなわけで、後々のことを考えてそのときの記録を残してみました。</p>
<h4>今回の検証環境</h4>
<p>Ubuntu8.10(サーバ版)<br />
WindowsXPのVMWare Server上で動作</p>
<h4>今回インストールしたもの(主なもの)</h4>
<p>ruby1.8.7<br />
gem1.3.2 (最近あがりましたね)<br />
rails2.3.2<br />
mongrel1.1.5<br />
SQLite3.5.9<br />
MySQL5.0.69<br />
PostgreSQL8.3.7<br />
vim-ruby<br />
vim-rails</p>
<h4>下準備</h4>
<h5>make, g++ のインストール</h5>
<p>インストールしたばかりのubuntuにはmakeもg++もないので真っ先にインストール</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential</pre></div></div>

<h5>pacoのインストール</h5>
<p>ソースからインストールしたソフトをパッケージ管理してくれるありがたいソフト！<br />
今回はソースからインストールしたものはgemだけだが、後々のことを考えて先にインストールしておく。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>paco<span style="color: #000000; font-weight: bold;">/</span>paco-2.0.6.tar.gz
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf paco-2.0.6.tar.gz
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> paco-2.0.6
&nbsp;
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--disable-gpaco</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h6>使用例</h6>
<p>インストール時にpacoをかませるとパッケージ管理してくれる。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-D</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>-Dオプションでディレクトリ名がパッケージ名になる</p>
<p>pacoに登録してあるパッケージの確認は↓</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">paco <span style="color: #660033;">-a</span></pre></div></div>

<p>アンインストールするときは下の1行をたたけばOK</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-r</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>削除するパッケージ名<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<h4>ruby1.8.7のインストール</h4>
<p>apt-getでインストール。その気になればruby1.9もaptからインストールすることも可能。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> irb1.8 libreadline-ruby1.8 libruby1.8 libruby1.8-dbg
rdoc1.8 ri1.8 ruby1.8 ruby1.8-dev ruby-debug</pre></div></div>

<h4>rubygemsのインストール</h4>
<p>rubyのパッケージ管理ソフト。railsのインストールなどに使用。aptからインストールすることも可能だが、バージョンが古くてrailsがうまく入らなかったことがあったので、これだけソースからインストールする。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">55066</span><span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.2.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf rubygems-1.3.2.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-1.3.2
<span style="color: #c20cb9; font-weight: bold;">sudo</span> paco <span style="color: #660033;">-D</span> ruby setup.rb</pre></div></div>

<h4>railsのインストール</h4>
<p>gemでインストール。特にバージョンを指定しない場合、最新のものが入る。<br />
(4/18に現在 2.3.2)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

<h4>mongrelのインストール</h4>
<p>ruby+C(拡張ライブラリ)で書かれたhttpd。railsにデフォルトで入っているWEBrickより早いが、<br />
本番運用だと何の前触れもなく落ちるなどの問題があったり。。開発環境はともかく、本番環境はPassengerにシフトしつつある。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libopenssl-ruby
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mongrel</pre></div></div>

<p>libopenssl-rubyがないとmongrelが起動しない。。。</p>
<h4>SQLite3でrails</h4>
<p>2系からrailsデフォルトになったDB。<br />
ファイルなので結構扱い気軽に扱えるというのが個人的感想。ただし、それゆえに1度ぽしゃったトラウマもあるが。。。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite3 libsqlite3-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite3-ruby</pre></div></div>

<h4>MySQLでrails</h4>
<p>1系ではこれがrails標準だった<br />
もちろん今でも結構使われている。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server libmysqlclient15-dev
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<h5>MySQL導入時にはまったこと</h5>
<p>・libmysqlclient15-devを入れるのを忘れると、gemでmysqlアダプタが入らなくてはまる。mysqlに限らず、他でもはまりがちなこと。。</p>
<p>・作成したユーザでログインできない。。。<br />
匿名ユーザが有効になっていると起きてしまう模様。<br />
この状態だと、どのユーザからも mysql とたたいただけで匿名ユーザでつながってしまう</p>
<p>そんな匿名ユーザは削除してしまうに限る</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">DELETE</span> <span style="color: #990099; font-weight: bold;">FROM</span> mysql.<span style="color: #000099;">user</span> <span style="color: #990099; font-weight: bold;">WHERE</span> <span style="color: #000099;">user</span><span style="color: #CC0099;">=</span><span style="color: #008000;">''</span><span style="color: #000033;">;</span>
FLUSH <span style="color: #990099; font-weight: bold;">PRIVILEGES</span><span style="color: #000033;">;</span></pre></div></div>

<h4>postgresでrails</h4>
<p>そこまで多くないが、案件によってはpostgresも使うことがある。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql-<span style="color: #000000;">8.3</span> postgresql-server-dev-<span style="color: #000000;">8.3</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> pg</pre></div></div>

<h5>Postgresではまったこと</h5>
<p>postgresユーザ以外でログインできない。。。<br />
postgresのUNIXソケットのデフォルトの設定でそうなっている。<br />
ポリシーとか、セキュリティを気にしないなら、<br />
<strong>/etc/postgresql/8.3/main/pg_hba.conf</strong>を以下のように編集</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Database administrative login by UNIX sockets</span>
<span style="color: #7a0874; font-weight: bold;">local</span>   all         all                          trust</pre></div></div>

<p>変更後、postgresの再起動を忘れずに</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>postgres restart</pre></div></div>

<h4>vimでrails開発しやすくする</h4>
<p>デフォルトで入っているvimはかなり貧弱だが、rubyとrailsのプラグインを導入するとかなり強力に進化する！</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> vim-ruby
vim-ruby-install.rb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> vim-rails
vim-rails-setup</pre></div></div>

<p>ここまでで、ubuntu上で十分railsの開発ができるはず。<br />
本当はもうちょっと入れると便利になるツールがあるけど、長くなった＆疲れたので残りはまた別な機会に。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daokaous.com/2009/04/ubuntu%e3%81%a7rails%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
