* 開発環境 All-In-One [#ke04ae92]
-[[即、Mac OSXでRails開発環境を構築「RM-Install」:http://www.moongift.jp/2007/09/rm-install/]]
* インストール (Mac OS X) [#c08a79cc]
1. [[Building Ruby, Rails, LightTPD, and MySQL on Tiger:http://hivelogic.com/narrative/articles/ruby_rails_lighttpd_mysql_tiger]] の手順でインストール。各ソフトウェアの最新バージョンを確認しつつ行う。
2007/7/7現在、以下のソフトのバージョンが変わっている。
readline (5.1 => 5.2)
Ruby (1.8.4 => 1.8.6)
RubyGems (0.9.0 => 0.9.4)
ruby-fcgi (0.8.6 => 0.8.7)
PCRE (6.6 => 6.7)
(1) readline
$ curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
$ tar xzvf readline-5.2.tar.gz
$ cd readline-5.2
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
(2) Ruby
$ curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
$ tar xzvf ruby-1.8.6.tar.gz
$ cd ruby-1.8.6
$ ./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local
$ make
$ sudo make install
$ sudo make install-doc
$ cd ..
(3) RubyGems
$ curl -O http://rubyforge-files.ruby-forum.com/rubygems/rubygems-0.9.4.tgz
$ tar xzvf rubygems-0.9.4.tgz
$ cd rubygems-0.9.4
$ sudo /usr/local/bin/ruby setup.rb
$ cd ..
(4) Ruby on Rails
$ sudo gem install rails --include-dependencies
(5) FastCGI
$ curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
$ tar xzvf fcgi-2.4.0.tar.gz
$ cd fcgi-2.4.0
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
(6) Ruby-FastCGI bindings
$ curl -O http://rubyforge.iasi.roedu.net/files/fcgi/ruby-fcgi-0.8.7.tar.gz
$ tar xzvf ruby-fcgi-0.8.7.tar.gz
$ cd ruby-fcgi-0.8.7
$ /usr/local/bin/ruby install.rb config --prefix=/usr/local
$ /usr/local/bin/ruby install.rb setup
$ sudo /usr/local/bin/ruby install.rb install
$ cd ..
この段階で動作確認をしておく。~
作業用のフォルダを作成し、そこで下記コマンドを実行。
$ rails test
$ cd test
$ ruby script/server
http://localhost:3000 にアクセスし、「Welcome aboard」の画面が表示されるのを確認
2. 多言語対応にするため、[[GNU GetText:http://directory.fsf.org/GNU/gettext.html]]、Ruby-GetText-Packageをインストールする。
(1) [[GNU GetText:http://directory.fsf.org/GNU/gettext.html]] のインストール
$ tar zxvf gettext-0.16.1.tar.gz
$ cd gettext-0.16.1
$ ./configure
$ make
$ sudo make install
(2) Ruby-GetText-Package のインストール
$ sudo gem install gettext
3. MySQL
(1) MySQLアダプタのインストール
$ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
(2) MySQLのライブラリのパス設定
"rake migrate" を実行して
dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found
Trace/BPT trap
といったエラーが出る場合は下記を実行する。
$ cd /usr/local/mysql/lib
$ sudo mkdir mysql
$ cd mysql
$ sudo ln -s /usr/local/mysql/lib/lib* .
4. PostgreSQL を使う場合は以下の作業を行う
(1) [[Postgres(Ruby extension library):http://ruby.scripting.ca/postgres/]] から ruby-postgres-0.7.1.tar.gz をダウンロードし、以下のコマンドでインストール
$ ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include --with-pgsql-lib-dir=/usr/local/pgsql/lib
$ make
$ sudo make install
(2) postgres-ruby をインストール
$ sudo gem install postgres -- --with-pgsql-dir=/usr/local/pgsql
4. ついでにRails専用IDE [[RadRails:http://www.radrails.org/]] もインストール~
[[ここ:http://rails.netlab.jp/rails/published/use_radrails]]を参考にインストール。
* インストール (Windows) [#k6bd4259]
-[[10分で作るRailsアプリ for Windows:http://masuidrive.jp/rails/]]
-[[windowsでrails:http://circle.cc.hokudai.ac.jp/ryu/pukiwiki/index.php?windows%A4%C7rails]]
* プラグイン [#yd6c03f1]
-[[Plugins in Ruby on Rails:http://wiki.rubyonrails.com/rails/pages/Plugins]]
** プラグインのインストール方法 [#g06562ce]
1. プラグインリポジトリの検索
$ ruby script/plugin discover
2. プラグインのインストール
$ ruby script/plugin install [プラグイン名]
3. プラグインの設定
4. config/environment.rb を変更した場合はサーバプロセス(WEBrick など)を再起動
※ 上記 1. でエラーになる場合は、以下のシェルスクリプトを実行してプラグインリポジトリを構築
#!/bin/sh
./script/plugin source http://svn.techno-weenie.net/projects/plugins/
./script/plugin source http://delynnberry.com/svn/code/rails/plugins/
./script/plugin source http://svn.recentrambles.com/plugins/
./script/plugin source http://opensvn.csie.org/rails_file_column/plugins/
./script/plugin source http://svn.protocool.com/rails/plugins/
./script/plugin source https://source.integrumtech.com/svn/public/plugins/
./script/plugin source http://tools.assembla.com/svn/breakout/breakout/vendor/plugins/
./script/plugin source http://svn.pragprog.com/Public/plugins/
./script/plugin source svn://rubyforge.org//var/svn/laszlo-plugin/rails/plugins/
./script/plugin source http://svn.inlet-media.de/svn/rails_extensions/plugins/
./script/plugin source http://svn.viney.net.nz/things/rails/plugins/
./script/plugin source http://svn.hasmanythrough.com/public/plugins/
./script/plugin source svn://caboo.se/plugins/
./script/plugin source http://shanesbrain.net/svn/rails/plugins/
./script/plugin source svn://errtheblog.com/svn/plugins/
./script/plugin source svn://svn.nkryptic.com/plugins/
./script/plugin source http://invisible.ch/svn/projects/plugins/
./script/plugin source http://hivelogic.com/plugins/
./script/plugin source https://secure.near-time.com/svn/plugins/
./script/plugin source http://mattmccray.com/svn/rails/plugins/
./script/plugin source http://svn.codefluency.com/rails/plugins/
./script/plugin source http://www.svn.recentrambles.com/plugins/
./script/plugin source http://tanjero.com/svn/plugins/
./script/plugin source http://filetofsole.org/svn/public/projects/rails/plugins/
./script/plugin source http://topfunky.net/svn/plugins/
./script/plugin source http://www.eric-stewart.com/svn/rails/plugins/
./script/plugin source http://joshpeek.com/svn/plugins/
./script/plugin source http://svn.aviditybytes.com/rails/plugins/
./script/plugin source http://beautifulpixel.textdriven.com/svn/plugins/
./script/plugin source http://mabs29.googlecode.com/svn/trunk/plugins/
./script/plugin source http://www.codyfauser.com/svn/projects/plugins/
./script/plugin source http://craz8.com/svn/trunk/plugins/
./script/plugin source http://sean.treadway.info/svn/plugins/
./script/plugin source http://svn.thebootstrapnation.com/public/plugins/
./script/plugin source http://www.mattmccray.com/svn/rails/plugins/
./script/plugin source svn://rubyforge.org//var/svn/validaterequest/plugins/
./script/plugin source http://xmlblog.stikipad.com/plugins/
./script/plugin source http://www.xml-blog.com/svn/plugins/
./script/plugin source http://svn.toolbocks.com/plugins/
./script/plugin source http://thar.be/svn/projects/plugins/
./script/plugin source http://code.teytek.com/rails/plugins/
./script/plugin source http://svn.teytek.com/rails/plugins/
./script/plugin source http://www.infused.org/svn/plugins/
./script/plugin source http://svn.mitchellhashimoto.com/plugins/
./script/plugin source http://svn.eastmedia.com/svn/bantay/plugins/
./script/plugin source http://svn.writertopia.com/svn/plugins/
./script/plugin source http://opensvn.csie.org/ezra/rails/plugins/
./script/plugin source http://svn.substance-it.co.uk/public/plugins/
./script/plugin source http://svn.rails-engines.org/plugins/
./script/plugin source http://activerbac.turingstudio.com/source/active_rbac/plugins/
./script/plugin source http://svn.openprofile.net/plugins/
./script/plugin source http://www.nickm.org/svn/repos/rails/plugins/
./script/plugin source http://cubesix.net/rails/plugins/
./script/plugin source http://svn.rtra.in/public/plugins/
** 開発環境 [#m812d178]
-[[Rails専用IDE「RadRails」でRailsをもっともっと快適に:http://www.itmedia.co.jp/enterprise/articles/0703/12/news018.html]]
** プラグイン一覧 [#l9562b36]
| プラグイン | 説明 | 実用度(0-10) | 参考URL |h
| Acts As Versioned | モデルに格納された内容がバージョン管理され、旧バージョンへのロールバックなどが簡単にできるようになる。 | ? | |
| Globalize | Railsを国際化対応にするプラグイン。言語ごとに文言を切り替えるだけでなく、日付や数値フォーマットの国際化をサポート。| ? | |
| Acts As Searchable | 全文検索エンジンであるHyperEstraierを使った検索機能を提供 | ? | |
| LoginEngine | ユーザ管理機能(ログイン機能) | ? | [[LoginEngineを使ってみる:http://tam.qmix.org/wiki/LoginEngine.html]] |
| File column | 画像ファイルのアップロード/表示/リサイズなどをサポート | ? | [[Ruby on Rails入門 第6回:プラグインでさらに生産性アップ:http://www.thinkit.co.jp/cert/article/0605/2/6/2.htm]] |
-ActiveHeart
* 携帯関係 [#e4382446]
-[[Rails で携帯用にビューを切り替え:http://www.kbmj.com/tech/index.php?itemid=28#nucleus_cf]]
* リンク集 [#wf6555e0]
-[[『ライド・オン・Rails』サポートページ:http://rorbook.moriq.com/]]
-[[Ruby on Rails を Mac OSX Tigerで:http://www.goodpic.com/mt/archives2/2005/09/ruby_on_rails_m_1.html]]
-[[必見!Railsがローカルアプリケーションに「Slingshot」:http://www.moongift.jp/2007/07/slingshot/]]