・Ruby on Rails


gem install rails --include-dependencies
※rdocがいらない時は gem install rails --no-rdoc 。(rdocのインストールでエラーになる場合がある時とか)

 http://www.kaoriya.net/#LIBICONV 等から各dllを取得してruby/bin に設置



gem install mysql


rails -d mysql example



  adapter: mysql
  database: example_development
  username: xxxxx
  password: xxxxx
  host: localhost
  encoding: utf8


rake db:create:all


ruby script/generate scaffold employee id:integer name:string age:integer


rake db:migrate


ruby script/server

※ WEBrickを使わずにApacheでCGIとして動かす場合は dispatch.rb に mod_rewriteする


gem install passenger

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

  LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
  PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.2.11
  PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific

Press ENTER to continue.

Deploying a Ruby on Rails application: an example

Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

  <VirtualHost *:80>
     ServerName www.yourhost.com
     DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
     &lt;Directory /somewhere/public&gt;
        AllowOverride all              # <-- relax Apache security settings
        Options -MultiViews            # <-- MultiViews must be turned off

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

  /Library/Ruby/Gems/1.8/gems/passenger-2.2.11/doc/Users guide Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.


トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-05-23 (日) 14:26:28 (4259d)