<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Narju.com &#187; RoR</title>
	<atom:link href="http://narju.com/category/website/ror/feed" rel="self" type="application/rss+xml" />
	<link>http://narju.com</link>
	<description>デザイン〜ビジネス〜ライフハックまで。</description>
	<lastBuildDate>Mon, 26 Jul 2010 05:40:06 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://narju.com/category/website/ror/feed" />
		<item>
		<title>emacsをrails仕様にカスタマイズ2</title>
		<link>http://narju.com/2009/05/739.html</link>
		<comments>http://narju.com/2009/05/739.html#comments</comments>
		<pubDate>Wed, 20 May 2009 03:57:20 +0000</pubDate>
		<dc:creator>narju</dc:creator>
				<category><![CDATA[RoR]]></category>
		<category><![CDATA[開発]]></category>

		<guid isPermaLink="false">http://narju.com/2009/05/739.html</guid>
		<description><![CDATA[git clone git://github.com/eschulte/rhtml.git  rinariにはsnippetが入っていないので yasnippet と Rails snippets をインストールします。 

...git clone git://github.com/eschulte/yasnippets-rails.git  これでrailsの開発環境が整いましたが、linum(行番号を表示機能)とelscreen(emacsにタブ機能)を追加します  


...rm ~/.emacs.d/elscreen-1.4.6.tar.gz  次に.emacsの設定に移ります。  


...	(setq default-buffer-file-coding-system 'utf-8) 	;;; base setting 	(setq line-number-mode t) ;;カーソル行番号表示 	(setq inhibit-startup-message t) ;;スタートアップメッセージ非表示 	(setq-default tab-width 4) ;;tab4文字 	(setq make-backup-files nil) ;;バックアップファイルを作らない 	(setq visible-bell t) ;;警告音無し 	(setq frame-title-format "%b") ;;タイトルにファイル名表示 	(display-time) ;;時計表示 	(auto-compression-mode t) ;;日本語info文字化け防止 	(global-hl-line-mode) ;;行ハイライト 	(tool-bar-mode nil) ;;ツールバー非表示 	(show-paren-mode 1) ;;対応括弧ハイライト 	 	;;; color 	(setq initial-frame-alist 	(append (list 	 '(width . ...  340) ;;X 表示位置 	) 	initial-frame-alist)) 	(setq default-frame-alist initial-frame-alist) 	(set-frame-parameter nil 'alpha 90 ) ;;windowの透明度設定 	 	;;; theme-monokai 	(custom-set-faces 	 '(default ((t (:stipple nil :background "#272822" :foreground "#F8F8F2" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :family "outline-consolas")))) 	 '(cursor ((t (:background "#F8F8F2" :foreground "#272822")))) 	 '(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground "#75715E")))) 	 '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "#A6E22E")))) 	 '(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground "#F92672")))) 	 '(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :foreground "#66d9ef")))) 	 '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "#E6DB74")))) 	 '(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground "#66d9ef")))) 	 '(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "#FD971F")))) 	 '(region ((((class color) (min-colors 88) (background dark)) (:background "#49483E")))) 	 '(show-paren-match ((((class color) (background dark)) (:background "#3E3D32")))) 	 '(variable-pitch ((t (:family "DejaVu Sans"))))) 	 	(setq load-path 	(append 	(list 	(expand-file-name "~/.emacs.d/") 	) 	load-path))  	;; Interactively Do Things (highly recommended, but not strictly required) 	(require 'ido) 	(ido-mode t)  	;; Rinari 	(add-to-list 'load-path "~/.emacs.d/rinari") 	(require 'rinari)  	;;; rhtml-mode 	(add-to-list 'load-path "~/.emacs.d/rhtml") 	(require 'rhtml-mode) 	(add-hook 'rhtml-mode-hook 	(lambda () (rinari-launch))) 	;;; yasnippet]]></description>
			<content:encoded><![CDATA[<p>手元にmac環境しかありませんのでmacで話を進めます。<br />
まずはCarbon Emacsを<a href="http://homepage.mac.com/zenitani/emacs-j.html" target="_blank">ダウンロード</a><br />
次に<a href="http://github.com/eschulte/rinari/tree/master" target="_blank">rinari</a>をダウンロード<br />
gitコマンドを入れてない人は<br />
Macの人は<a href="http://www.macports.org/" target="_blank">mac ports</a>をインストールしてください</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">sudo port install git-core +gitweb +svn</pre></div></div>

<p>GUIが良い人は<a href="http://porticus.alittledrop.com/" target="_blank">porticus</a>からでもgitを入れてください。<br />
さて、gitのインストールがすんでいる人はrinariとrhtml-mode(erbのハイライト)をインストールします。<br />
インストールする場所は何処でも良いのですがここではホームディレクトリ以下の~/.emacs.d/にインストールします</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">cd ~/.emacs.d
git clone git://github.com/eschulte/rinari.git
cd rinari
git submodule init
git submodule update
cd ~/.emacs.d
git clone git://github.com/eschulte/rhtml.git</pre></div></div>

<p>rinariにはsnippetが入っていないので<a href="http://code.google.com/p/yasnippet/" target="_blank">yasnippet</a>と<a href="http://github.com/eschulte/yasnippets-rails/tree/master" target="_blank">Rails snippets</a>をインストールします。<br />
yasnippetのダウンロードページにはyasnippet-bundleとyasnippetがありますが<br />
今回はyasnippet-0.5.10.tar.bz2をダウンロード</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">cd ~/.emacs.d
curl -O http://yasnippet.googlecode.com/files/yasnippet-0.5.10.tar.bz2
tar jxf yasnippet-0.5.10.tar.bz2
cd yasnippet-0.5.10
mv * ../
cd ../
rm -rf yasnippet-0.5.10
rm yasnippet-0.5.10.tar.bz2
cd ~/.emacs.d/snippets
git clone git://github.com/eschulte/yasnippets-rails.git</pre></div></div>

<p>これでrailsの<span class='wp_keywordlink_affiliate'><a href="http://narju.com/tag/%e9%96%8b%e7%99%ba" title="開発 の投稿をすべて表示" target="_blank">開発</a></span>環境が整いましたが、linum(行番号表示機能)とelscreen(タブ機能)を追加します</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">cd ~/.emacs.d/
curl -O http://stud4.tuwien.ac.at/~e0225855/linum/linum.el
curl -O ftp://ftp.morishima.net:21//pub/morishima.net/naoto/ElScreen/elscreen-1.4.6.tar.gz
tar xzvf elscreen-1.4.6.tar.gz
mv ~/.emacs.d/elscreen-1.4.6/elscreen.el ~/.emacs.d/
rm -rf ~/.emacs.d/elscreen-1.4.6
rm ~/.emacs.d/elscreen-1.4.6.tar.gz</pre></div></div>

<p>次に.emacsの設定に移ります。</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">cd ~/
vi .emacs</pre></div></div>

<p>なんでviなんだって話だと思うんですが、emacsにまだなれてなくて。。</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">;;; utf8
(set-language-environment &quot;Japanese&quot;)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
&nbsp;
;;; base setting
(setq line-number-mode t) ;;カーソル行番号表示
(setq inhibit-startup-message t) ;;スタートアップメッセージ非表示
(setq-default tab-width 4) ;;tab4文字
(setq make-backup-files nil) ;;バックアップファイルを作らない
(setq visible-bell t) ;;警告音無し
(setq frame-title-format &quot;%b&quot;) ;;タイトルにファイル名表示
(display-time) ;;時計表示
(auto-compression-mode t) ;;日本語info文字化け防止
(global-hl-line-mode) ;;行ハイライト
(tool-bar-mode nil) ;;ツールバー非表示
(show-paren-mode 1) ;;対応括弧ハイライト
&nbsp;
;;; color
(setq initial-frame-alist
(append (list
 '(width . 120) ;;フレームの幅
 '(height . 40) ;;フレームの高さ
 '(top . 0) ;;Y 表示位置
 '(left . 340) ;;X 表示位置
)
initial-frame-alist))
(setq default-frame-alist initial-frame-alist)
(set-frame-parameter nil 'alpha 90 ) ;;windowの透明度設定
&nbsp;
;;; theme-monokai
(custom-set-faces
 '(default ((t (:stipple nil :background &quot;#272822&quot; :foreground &quot;#F8F8F2&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :family &quot;outline-consolas&quot;))))
 '(cursor ((t (:background &quot;#F8F8F2&quot; :foreground &quot;#272822&quot;))))
 '(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#75715E&quot;))))
 '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#A6E22E&quot;))))
 '(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#F92672&quot;))))
 '(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :foreground &quot;#66d9ef&quot;))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#E6DB74&quot;))))
 '(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#66d9ef&quot;))))
 '(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#FD971F&quot;))))
 '(region ((((class color) (min-colors 88) (background dark)) (:background &quot;#49483E&quot;))))
 '(show-paren-match ((((class color) (background dark)) (:background &quot;#3E3D32&quot;))))
 '(variable-pitch ((t (:family &quot;DejaVu Sans&quot;)))))
&nbsp;
(setq load-path
(append
(list
(expand-file-name &quot;~/.emacs.d/&quot;)
)
load-path))
&nbsp;
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
&nbsp;
;; Rinari
(add-to-list 'load-path &quot;~/.emacs.d/rinari&quot;)
(require 'rinari)
&nbsp;
;;; rhtml-mode
(add-to-list 'load-path &quot;~/.emacs.d/rhtml&quot;)
(require 'rhtml-mode)
(add-hook 'rhtml-mode-hook
(lambda () (rinari-launch)))
&nbsp;
;;; yasnippet
(require 'yasnippet)
(yas/initialize)
(yas/load-directory &quot;~/.emacs.d/snippets/rails-snippets&quot;)
&nbsp;
;;; line-number 
(require 'linum)
(global-linum-mode t)
(setq linum-format &quot;%5d&quot;)
&nbsp;
;;; elscreen
(require 'elscreen)
;; PrefixキーをC-zに割り当て
(if window-system
 (define-key elscreen-map &quot;\C-z&quot; 'iconify-or-deiconify-frame)
  (define-key elscreen-map &quot;\C-z&quot; 'suspend-emacs))</pre></div></div>

<p>エラーが出るようであればpluginのパスを環境に合わせて変えてみてください。<br />
emacsを立ち上げて<br />
<img src="http://narju.com/wp-content/uploads/2009/05/emacs.png" width="480" height="341" alt="emacs emacsをrails仕様にカスタマイズ2"  title="emacsをrails仕様にカスタマイズ2" /><br />
こんな画面になれば成功です。<br />
C-c ; wでmongrel起動<br />
C-c C-cでmongrel終了<br />
その他キーバインドはまた次の機会にでも書きたいと思います。<br />
間違い等がありましたら教えて頂けると助かります。</p>
]]></content:encoded>
			<wfw:commentRss>http://narju.com/2009/05/739.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://narju.com/2009/05/739.html" />
	</item>
		<item>
		<title>emacsをrails仕様にカスタマイズ</title>
		<link>http://narju.com/2009/05/736.html</link>
		<comments>http://narju.com/2009/05/736.html#comments</comments>
		<pubDate>Tue, 19 May 2009 16:02:59 +0000</pubDate>
		<dc:creator>narju</dc:creator>
				<category><![CDATA[RoR]]></category>
		<category><![CDATA[開発]]></category>

		<guid isPermaLink="false">http://narju.com/2009/05/736.html</guid>
		<description><![CDATA[さて、日々の開発はtextmateで行っているのですが、emacsはC++のコーディングにしか使った事なく、ほとんど使い方がわからなかったのですが、rinariを使うとかなりイケテルとの事でなんとなくがんがん入れてみました。   

...'(default ((t (:stipple nil :background "#272822" :foreground "#F8F8F2" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :family "outline-consolas"))))


...'(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground "#66d9ef"))))


'(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "#FD971F"))))


...I get so tired of searching for programming editor color schemes  またrails用に ido  rinari   yasnippet + rails-snippets (スニペット)  linum (行表示)  elscreen (tab表示)  ruby-block (対応ブロック表示) を使っています。]]></description>
			<content:encoded><![CDATA[<p>さて、日々の<span class='wp_keywordlink_affiliate'><a href="http://narju.com/tag/%e9%96%8b%e7%99%ba" title="開発 の投稿をすべて表示" target="_blank">開発</a></span>はtextmateで行っているのですが、何となくemacsくらい使えないとだめかなぁと思い立ちCarbon Emacsをダウンロード<br />
emacsはC++のコーディングにしか使った事なく、ほとんど使い方がわからなかったのですが、rinariを使うとかなりイケテルとの事でなんとなく入れてみました。<br />
<img src="http://narju.com/wp-content/uploads/2009/05/emacs.png" width="480" height="341" alt="emacs emacsをrails仕様にカスタマイズ"  title="emacsをrails仕様にカスタマイズ" /><br />
textmateでも使っているmonokaiというテーマのパクリです。<br />
.emacs.elにでも貼付けてください。</p>

<div class="wp_syntax"><div class="code"><pre class="code" style="font-family:monospace;">(custom-set-faces
'(default ((t (:stipple nil :background &quot;#272822&quot; :foreground &quot;#F8F8F2&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :family &quot;outline-consolas&quot;))))
'(cursor ((t (:background &quot;#F8F8F2&quot; :foreground &quot;#272822&quot;))))
'(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#75715E&quot;))))
'(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#A6E22E&quot;))))
'(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#F92672&quot;))))
'(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :foreground &quot;#66d9ef&quot;))))
'(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#E6DB74&quot;))))
'(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#66d9ef&quot;))))
'(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground &quot;#FD971F&quot;))))
'(region ((((class color) (min-colors 88) (background dark)) (:background &quot;#49483E&quot;))))
'(show-paren-match ((((class color) (background dark)) (:background &quot;#3E3D32&quot;))))
'(variable-pitch ((t (:family &quot;DejaVu Sans&quot;)))))</pre></div></div>

<p>テーマは下記ページからの引用です。<br />
<a href="http://jaguilar.posterous.com/i-get-so-tired-of-searching-fo" target="_blank">I get so tired of searching for programming editor color schemes</a><br />
いやあああつかいやすいわあああああ！<br />
textmateとはまた違う操作感。textmateを使ってなかったら100%こちらを使うでしょうね！<br />
ということでrails用にって何をって話で以下のplugin？とか入れてます。<br />
ido<br />
<a href="http://rinari.rubyforge.org/">rinari</a><br />
<a href="http://code.google.com/p/yasnippet/">yasnippet</a>+<a href="http://github.com/eschulte/yasnippets-rails/tree/master" target="_blank">rails-snippets</a>(スニペット)<br />
<a href="http://stud4.tuwien.ac.at/~e0225855/linum/linum.html" target="_blank">linum</a>(行表示)<br />
<a href="http://www.morishima.net/~naoto/software/elscreen/index.php.ja" target="_blank">elscreen</a>(tab表示)<br />
<a href="http://www.emacswiki.org/emacs/ruby-block.el" target="_blank">ruby-block</a>(対応ブロック表示)<br />
を使っています。反応があれば、emacs.elとpluginの設定でも次回書きますか。<br />
あぁ。emacsよくわかってないので小汚くても良ければですが。</p>
<p><a href="http://narju.com/2009/05/739.html">emacsをrails仕様にカスタマイズ2</a>へ続く</p>
]]></content:encoded>
			<wfw:commentRss>http://narju.com/2009/05/736.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://narju.com/2009/05/736.html" />
	</item>
		<item>
		<title>Ruby on Rails 2.3 をMacOSXにインストール</title>
		<link>http://narju.com/2009/04/614.html</link>
		<comments>http://narju.com/2009/04/614.html#comments</comments>
		<pubDate>Sun, 26 Apr 2009 14:45:21 +0000</pubDate>
		<dc:creator>narju</dc:creator>
				<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://narju.com/2009/04/614.html</guid>
		<description><![CDATA[If I run gems list it does not show mysql, so I tried to run the gem install and got the following: ERROR: Error installing mysql: ERROR: Failed to build gem native extension.

...checking for mysql_query() in -lmysqlclient... no


...checking for mysql_query() in -lmysqlclient... no


...checking for mysql_query() in -lmysqlclient... no


...checking for mysql_query() in -lmysqlclient... no  rails 2.2?]]></description>
			<content:encoded><![CDATA[<p>さて、我が家のMac book proのHDDが飛んだ為にrailsを再インストール/アップデートした際のメモ。<br />
Mac OSX 10.5.6でのお話。</p>
<p>まずはgem本体をupdate</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 update <span style="color: #660033;">--system</span></pre></div></div>

<p>インストールされている全てをupdate</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 update</pre></div></div>

<p>次にMySQLをインストール。MAMPと迷った物の若干更新が遅いようなのでMySQL.comよりMac用MySQLserverをDL。<br />
が、罠が。まず一つ目。<br />
なにも考えずMac OS X 10.5 (x86_64)をダウントードしたのですが、まぁなんだかんだでエラーが出ます。<br />
特に理由が無ければMac OS X 10.5 (x86)を使いましょう。<br />
<a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" target="_blank">Mac OS X 10.5 (x86)</a></p>
<p><span id="more-614"></span>
<p>二つ目の罠。<br />
意気揚々とrake db:migrateとするもののエラー。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ db:migrate
<span style="color: #000000; font-weight: bold;">!!!</span> The bundled mysql.rb driver has been removed from Rails 2.2. Please <span style="color: #c20cb9; font-weight: bold;">install</span> the mysql gem and try again: gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql.
rake aborted<span style="color: #000000; font-weight: bold;">!&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>If I run gems list it does not show mysql, so I tried to run the gem <span style="color: #c20cb9; font-weight: bold;">install</span> and got the following:<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>ERROR: Error installing mysql:<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span>ERROR: Failed to build gem native extension.<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>Ruby.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby extconf.rb <span style="color: #c20cb9; font-weight: bold;">install</span> mysql
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient... no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lm... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient... no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lz... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient... no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lsocket... no
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient... no
checking <span style="color: #000000; font-weight: bold;">for</span> main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lnsl... no
checking <span style="color: #000000; font-weight: bold;">for</span> mysql_query<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lmysqlclient... no</pre></div></div>

<p>rails 2.2?からMySQLのドライバーを別途インストールする必要があるとの事。はぁ。</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> mysql <span style="color: #660033;">--</span> <span style="color: #660033;">--with-mysql-config</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config</pre></div></div>

<p>とりあえず。rails2.3でsampleを動かさねばと、せっかくMySQLを入れたので、MySQLで行きます。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rails bookmark <span style="color: #660033;">-d</span> mysql
create
create  app<span style="color: #000000; font-weight: bold;">/</span>controllers
create  app<span style="color: #000000; font-weight: bold;">/</span>helpers
create  app<span style="color: #000000; font-weight: bold;">/</span>models
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>layouts
create  config<span style="color: #000000; font-weight: bold;">/</span>environments
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers
create  config<span style="color: #000000; font-weight: bold;">/</span>locales
create  db
create  doc
create  lib
create  lib<span style="color: #000000; font-weight: bold;">/</span>tasks
create  log
create  public<span style="color: #000000; font-weight: bold;">/</span>images
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts
create  public<span style="color: #000000; font-weight: bold;">/</span>stylesheets
create  script<span style="color: #000000; font-weight: bold;">/</span>performance
create  test<span style="color: #000000; font-weight: bold;">/</span>fixtures
create  test<span style="color: #000000; font-weight: bold;">/</span>functional
create  test<span style="color: #000000; font-weight: bold;">/</span>integration
create  test<span style="color: #000000; font-weight: bold;">/</span>performance
create  test<span style="color: #000000; font-weight: bold;">/</span>unit
create  vendor
create  vendor<span style="color: #000000; font-weight: bold;">/</span>plugins
create  tmp<span style="color: #000000; font-weight: bold;">/</span>sessions
create  tmp<span style="color: #000000; font-weight: bold;">/</span>sockets
create  tmp<span style="color: #000000; font-weight: bold;">/</span>cache
create  tmp<span style="color: #000000; font-weight: bold;">/</span>pids
create  Rakefile
create  README
create  app<span style="color: #000000; font-weight: bold;">/</span>controllers<span style="color: #000000; font-weight: bold;">/</span>application_controller.rb
create  app<span style="color: #000000; font-weight: bold;">/</span>helpers<span style="color: #000000; font-weight: bold;">/</span>application_helper.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>database.yml
create  config<span style="color: #000000; font-weight: bold;">/</span>routes.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>locales<span style="color: #000000; font-weight: bold;">/</span>en.yml
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>backtrace_silencers.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>inflections.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>mime_types.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>new_rails_defaults.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>session_store.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>environment.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>boot.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>environments<span style="color: #000000; font-weight: bold;">/</span>production.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>environments<span style="color: #000000; font-weight: bold;">/</span>development.rb
create  config<span style="color: #000000; font-weight: bold;">/</span>environments<span style="color: #000000; font-weight: bold;">/</span>test.rb
create  script<span style="color: #000000; font-weight: bold;">/</span>about
create  script<span style="color: #000000; font-weight: bold;">/</span>console
create  script<span style="color: #000000; font-weight: bold;">/</span>dbconsole
create  script<span style="color: #000000; font-weight: bold;">/</span>destroy
create  script<span style="color: #000000; font-weight: bold;">/</span>generate
create  script<span style="color: #000000; font-weight: bold;">/</span>runner
create  script<span style="color: #000000; font-weight: bold;">/</span>server
create  script<span style="color: #000000; font-weight: bold;">/</span>plugin
create  script<span style="color: #000000; font-weight: bold;">/</span>performance<span style="color: #000000; font-weight: bold;">/</span>benchmarker
create  script<span style="color: #000000; font-weight: bold;">/</span>performance<span style="color: #000000; font-weight: bold;">/</span>profiler
create  test<span style="color: #000000; font-weight: bold;">/</span>test_helper.rb
create  test<span style="color: #000000; font-weight: bold;">/</span>performance<span style="color: #000000; font-weight: bold;">/</span>browsing_test.rb
create  public<span style="color: #000000; font-weight: bold;">/</span>404.html
create  public<span style="color: #000000; font-weight: bold;">/</span>422.html
create  public<span style="color: #000000; font-weight: bold;">/</span>500.html
create  public<span style="color: #000000; font-weight: bold;">/</span>index.html
create  public<span style="color: #000000; font-weight: bold;">/</span>favicon.ico
create  public<span style="color: #000000; font-weight: bold;">/</span>robots.txt
create  public<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>rails.png
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts<span style="color: #000000; font-weight: bold;">/</span>prototype.js
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts<span style="color: #000000; font-weight: bold;">/</span>effects.js
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts<span style="color: #000000; font-weight: bold;">/</span>dragdrop.js
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts<span style="color: #000000; font-weight: bold;">/</span>controls.js
create  public<span style="color: #000000; font-weight: bold;">/</span>javascripts<span style="color: #000000; font-weight: bold;">/</span>application.js
create  doc<span style="color: #000000; font-weight: bold;">/</span>README_FOR_APP
create  log<span style="color: #000000; font-weight: bold;">/</span>server.log
create  log<span style="color: #000000; font-weight: bold;">/</span>production.log
create  log<span style="color: #000000; font-weight: bold;">/</span>development.log
create  log<span style="color: #000000; font-weight: bold;">/</span>test.log
$ <span style="color: #7a0874; font-weight: bold;">cd</span> Bookmark</pre></div></div>

<p>はいはい、サクサクとフィールドを追加。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ script<span style="color: #000000; font-weight: bold;">/</span>generate scaffold bookmark name:string url:string
exists  app<span style="color: #000000; font-weight: bold;">/</span>models<span style="color: #000000; font-weight: bold;">/</span>
exists  app<span style="color: #000000; font-weight: bold;">/</span>controllers<span style="color: #000000; font-weight: bold;">/</span>
exists  app<span style="color: #000000; font-weight: bold;">/</span>helpers<span style="color: #000000; font-weight: bold;">/</span>
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>bookmarks
exists  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>layouts<span style="color: #000000; font-weight: bold;">/</span>
exists  test<span style="color: #000000; font-weight: bold;">/</span>functional<span style="color: #000000; font-weight: bold;">/</span>
exists  test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>
create  test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>helpers<span style="color: #000000; font-weight: bold;">/</span>
exists  public<span style="color: #000000; font-weight: bold;">/</span>stylesheets<span style="color: #000000; font-weight: bold;">/</span>
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>bookmarks<span style="color: #000000; font-weight: bold;">/</span>index.html.erb
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>bookmarks<span style="color: #000000; font-weight: bold;">/</span>show.html.erb
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>bookmarks<span style="color: #000000; font-weight: bold;">/</span>new.html.erb
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>bookmarks<span style="color: #000000; font-weight: bold;">/</span>edit.html.erb
create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>layouts<span style="color: #000000; font-weight: bold;">/</span>bookmarks.html.erb
create  public<span style="color: #000000; font-weight: bold;">/</span>stylesheets<span style="color: #000000; font-weight: bold;">/</span>scaffold.css
create  app<span style="color: #000000; font-weight: bold;">/</span>controllers<span style="color: #000000; font-weight: bold;">/</span>bookmarks_controller.rb
create  test<span style="color: #000000; font-weight: bold;">/</span>functional<span style="color: #000000; font-weight: bold;">/</span>bookmarks_controller_test.rb
create  app<span style="color: #000000; font-weight: bold;">/</span>helpers<span style="color: #000000; font-weight: bold;">/</span>bookmarks_helper.rb
create  test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>helpers<span style="color: #000000; font-weight: bold;">/</span>bookmarks_helper_test.rb
route  map.resources :bookmarks
dependency  model
exists    app<span style="color: #000000; font-weight: bold;">/</span>models<span style="color: #000000; font-weight: bold;">/</span>
exists    test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>
exists    test<span style="color: #000000; font-weight: bold;">/</span>fixtures<span style="color: #000000; font-weight: bold;">/</span>
create    app<span style="color: #000000; font-weight: bold;">/</span>models<span style="color: #000000; font-weight: bold;">/</span>bookmark.rb
create    test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>bookmark_test.rb
create    test<span style="color: #000000; font-weight: bold;">/</span>fixtures<span style="color: #000000; font-weight: bold;">/</span>bookmarks.yml
create    db<span style="color: #000000; font-weight: bold;">/</span>migrate
create    db<span style="color: #000000; font-weight: bold;">/</span>migrate<span style="color: #000000; font-weight: bold;">/</span>XXXXXXXXXX_create_bookmarks.rb</pre></div></div>

<p>次に「bookmark_development」というDBを作成して。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rake db:migrate
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>XXXXXXX<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>bookmark<span style="color: #7a0874; font-weight: bold;">&#41;</span>
==  CreateBookmarks: migrating ================================================
<span style="color: #660033;">--</span> create_table<span style="color: #7a0874; font-weight: bold;">&#40;</span>:bookmarks<span style="color: #7a0874; font-weight: bold;">&#41;</span>
-<span style="color: #000000; font-weight: bold;">&amp;</span>gt; 0.0893s
==  CreateBookmarks: migrated <span style="color: #7a0874; font-weight: bold;">&#40;</span>0.0896s<span style="color: #7a0874; font-weight: bold;">&#41;</span> =======================================</pre></div></div>

<p>起動です。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ script<span style="color: #000000; font-weight: bold;">/</span>server</pre></div></div>

<p>http://localhost:3000/bookmarksを確認して終了。<br />
おつかれさまでした。</p>
]]></content:encoded>
			<wfw:commentRss>http://narju.com/2009/04/614.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://narju.com/2009/04/614.html" />
	</item>
	</channel>
</rss>
