install ruby on rails and redmine on ubuntu

1. used source files

ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
( 최신버전으로 1.6.x를 설치해보았으니 rubygem 1.6과 redmine 1.1.2와 호환되지 않는듯
http://rubyforge.org/frs/download.php/74419/redmine-1.1.2.tar.gz

2. ruby

ruby 압축을 풀고
>./configure
>make
>make install

3. rubygems 설치

압축을 풀고
>ruby setup.rb ( 필요한 경우 sudo )

4. Rails 설치

>gem install rake
>gem install rails -v=2.3.5
<code>&gt;gem install rack -v=1.0.1</code>
<code>
</code>

5. Mysql 구성

>mysql -u root mysql -p
mysql&gt; create database redmine character set utf8;
mysql&gt; create user 'redmine'@'localhost' identified by '암호;
mysql&gt; grant all privileges on redmine.* to 'redmine'@'localhost';

<strong>6.Redmine 구성</strong>
>cd /usr/local/
>tar xvfz /usr/local/src/redmine-1.1.2.tar.gz
>cd redmine-1.1.2/
>config/database.yml.example config/database.yml
>nano config/database.yml
   production:
   adapter: mysql
   database: redmine
   host: localhost
   username: redmine
   password:암호
   encoding: utf8
<pre id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown">&gt;gem install -v=0.4.2 i18n

>RAILS_ENV=production rake config/initializers/session_store.rb

&gt;apt-get install libmysqlclient15-dev (MySql 4.x 인 경우 libmysqlclient12-dev)
<pre id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown">&gt;gem install mysql

>RAILS_ENV=production rake db:migrate

>RAILS_ENV=production rake redmine:load_default_data

>ruby script/server webrick -e production

http://IP:3000/으로 확인

서버 종료시 Ctrl+C 사용

<strong>7. Passenger 사용하여 Rails 프로젝트 Apache에 연결</strong>
 * 참고사이트 : http://srue.net/91
> gem install passenger
  잘 안되는 경우에는 rm -r ~/.gem
> passenger-install-apache2-module
  시키는대로 설치한다.
  apache가 다른 경로에 있는 경우에는 path에 추가 후 실행한다.
> export PATH=/usr/local/apache2/bin:$PATH
  PATH를 지정해도 안되는 경우에 sudo 명령을 사용하지 말고 디렉토리 권한을 변경 후 다시 시도해본다.
  설치가 완료되면 Apache를 어떻게 수정하라고 알려준다. 알려준대로 수정 후 아파치 리스타트
* 가상호스트 없이 접속하는 방법으로
<a href="http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/">http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/</a>
를 참조하였으나 뭔가 오류 발생
<div id="_mcePaste">*** Exception SecurityError in spawn manager (Insecure operation - exist?) (process 27151, thread #&lt;Thread:0xb781a1ac&gt;):</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/utils/tmpdir.rb:51:in `exist?'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/utils/tmpdir.rb:51:in `passenger_tmpdir'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/utils/tmpdir.rb:31:in `passenger_tmpdir'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:119:in `initialize'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/classic_rails/application_spawner.rb:117:in `initialize'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:201:in `new'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:201:in `spawn_rails_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:215:in `call'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:215:in `spawn_rails_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `__send__'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'</div>
<div id="_mcePaste">from /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/helper-scripts/passenger-spawn-server:99</div>
아직 원인 해결 못함.. ㅠㅗㅜ