사용자 도구

사이트 도구


develop:ruby

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
다음 판 양쪽 다음 판
develop:ruby [2007/02/06 14:42]
mattabu 새로 만듬
develop:ruby [2014/04/10 11:21]
starlits
줄 1: 줄 1:
 ====== Ruby ====== ====== Ruby ======
  
-===== Using Ruby on Debian Linux ===== +  - [[develop:ruby:install Ruby installation ]] 
-==== Install on Debian Linux ==== +  - [[develop:ruby:env | Set Rails Environment ]]
-package 를 찾아보면 ruby, ruby1.8 이 있는데 이중에서 어떤 것을 설치해야 할지 모르겠다. +
-버전이 약간 차이가 있는데, 다른 부분은 어떻게 다른지 알 수 없다. +
-다시 확인해보니, ruby 를 설치하면 ruby1.8이 함께 설치되는 것이었다. 그러므로 다음과 같이 설치하면 된다. +
-<code> +
-# apt-get install ruby irb ri libfcgi-ruby1.8 libpgsql-ruby1.8 +
-</code> +
-  * The **irb** is acronym for Interactive RuBy.  It evaluates Ruby expression from the terminal. +
-  * **ri** is a command line tool that displays descriptions of built-in Ruby methods, classes, and modules. For methods, it shows you the calling sequence and a description. For classes and modules, it shows a synopsis along with a list of the methods the class or module implements.+
  
-==== Install RubyGems ==== +===== Set Rails Environment (1) ===== 
-RubyGems는 Ruby의 표준 패키지 관리프로그램이다. 그런데 아직 Debian Linux에는 RubyGems 패키지가 나오지 않은 듯 하다. +**Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 on Debian (Etch) Linux** \\ 
-<code> +mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. Debian (Etch) Linux 의 Ruby 버전은 1.8.5 이므로 충족된다.
-# wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz +
-# tar xvfz rubygems-0.9.0.tgz +
-# cd rubygems-0.9.0 +
-# ruby setup.rb +
-</code> +
- +
-===== Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 ===== +
-Debian Linux 에서는 아직 지원되지 않는 패키지라서 직접 소스로 설치해야 한다. 우선 프로그램을 설치할 디렉토리를 생성한다. +
-<code> +
-# mkdir /opt/rails +
-</code> +
- +
-==== Install ruby 1.8.5 ==== +
-mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. +
-<code> +
-# cd /opt/src +
-# wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz +
-# tar xvfz ruby-1.8.5.tar.gz +
-# cd ruby-1.8.5 +
-# ./configure; make; make install +
-</code> +
- +
-==== Install RubyGems ==== +
-RubyGems는 Ruby의 표준 패키지 관리프그램이다. +
-<code> +
-# cd /opt/src +
-# wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz +
-# tar xvfz rubygems-0.9.0.tgz +
-# cd rubygems-0.9.0 +
-# ruby setup.rb +
-</code>+
  
 ==== Install Rails ==== ==== Install Rails ====
줄 57: 줄 18:
 # gem update --system # gem update --system
 # gem install mongrel mongrel_cluster --include-dependencies # gem install mongrel mongrel_cluster --include-dependencies
 +Select which gem to install for your platform (i486-linux)
 + 1. mongrel 1.0.1 (ruby)
 + 2. mongrel 1.0.1 (mswin32)
 + 3. mongrel 1.0 (mswin32)
 + 4. mongrel 1.0 (ruby)
 + 5. Skip this gem
 + 6. Cancel installation
 +> 1
 +Select which gem to install for your platform (i486-linux)
 + 1. fastthread 1.0 (ruby)
 + 2. fastthread 1.0 (mswin32)
 + 3. fastthread 0.6.4.1 (mswin32)
 + 4. fastthread 0.6.4.1 (ruby)
 + 5. Skip this gem
 + 6. Cancel installation
 +> 1
 +Building native extensions.  This could take a while...
 +Building native extensions.  This could take a while...
 +Successfully installed mongrel-1.0.1
 +Successfully installed fastthread-1.0
 +Successfully installed gem_plugin-0.2.2
 +Successfully installed cgi_multipart_eof_fix-2.1
 +Installing ri documentation for mongrel-1.0.1...
 +Installing ri documentation for gem_plugin-0.2.2...
 +Installing ri documentation for cgi_multipart_eof_fix-2.1...
 +Installing RDoc documentation for mongrel-1.0.1...
 +Installing RDoc documentation for gem_plugin-0.2.2...
 +Installing RDoc documentation for cgi_multipart_eof_fix-2.1...
 +Successfully installed mongrel_cluster-0.2.1
 +</code>
 +
 +==== Install MySQL Module for ruby ====
 +<code>
 +# apt-get install libmysqlclient15-dev
 +# gem install mysql
 +Select which gem to install for your platform (i486-linux)
 + 1. mysql 2.7.3 (mswin32)
 + 2. mysql 2.7.1 (mswin32)
 + 3. mysql 2.7 (ruby)
 + 4. mysql 2.6 (ruby)
 + 5. Skip this gem
 + 6. Cancel installation
 +> 3
 +Building native extensions.  This could take a while...
 +Successfully installed mysql-2.7
 </code> </code>
  
 ==== Install Apache 2.2.3 ==== ==== Install Apache 2.2.3 ====
 <code> <code>
-cd /opt/src +apt-get install apache2.2-common
-# wget http://ftp.kaist.ac.kr/pub/Apache/httpd/httpd-2.2.3.tar.gz +
-# tar xvfz httpd-2.2.3.tar.gz +
-# cd httpd-2.2.3 +
-# ./configure --prefix=/opt/rails/apache2 --enable-modules=so --enable-so \ +
---enable-rewrite --enable-deflate \ +
---enable-proxy --enable-proxy-html \  +
---enable-proxy-balancer --enable-cache \  +
---enable-mem-cache --enable-headers +
-# make; make install+
 </code> </code>
  
-==== Install PHP 5.1.6 ====+==== Install PHP 5 ====
 <code> <code>
-# apt-get install libxml2 libxml2-dev libxml2-utils +# apt-get install libapache2-mod-php5
-# cd /opt/src +
-# wget http://kr2.php.net/get/php-5.1.6.tar.gz/from/kr.php.net/mirror +
-# tar xvfz php-5.1.6.tar.gz +
-# cd php-5.1.6 +
-# ./configure \ +
---prefix=/opt/rails/php5 +
---with-apxs2=/opt/rails/apache2/bin/apxs \ +
---enable-xml \ +
---enable-libxml \ +
---with-xmlrpc \ +
---with-iconv \ +
---enable-calendar \ +
---enable-sysvshm=yes --enable-sysvsem=yes \ +
---enable-debug=no --enable-track-vars=yes \ +
---enable-url-fopen-wrapper=yes \ +
---enable-ftp \ +
---enable-memory-limit --enable-mbstring \ +
---enable-sockets \ +
---enable-wddx \ +
---enable-bcmath --enable-mbstr-enc-trans \ +
---enable-mbregex --enable-exif \ +
---with-ttf \ +
---with-pdo-pgsql --with-pgsql +
- +
---with-openssl=/usr \ +
---enable-gd-native-ttf --enable-gd-imgstrttf \ +
---with-gd \ +
---with-freetype-dir=/usr \ +
---with-tiff-dir=/usr \ +
---with-png-dir=/usr --with-zlib-dir --with-jpeg-dir=/usr \ +
---with-mysql=/usr/local/mysql \ +
---with-gdbm=/usr +
- +
-# make; make install+
 </code> </code>
  
 ==== Setting Apache2 ==== ==== Setting Apache2 ====
 <code> <code>
-vi /opt/rails/apache2/conf/httpd.conf +cd /etc/apache2/mods-enabled 
-LoadModule php5_module modules/libphp5.so +# ln -../mods-available/rewrite.load rewrite.load 
-AddType application/x-httpd-php .php .html .htm .inc +</code> 
-AddType application/x-httpd-php-source .phps +<code> 
-DirectoryIndex index.php index.html +# vi /etc/apache2/sites-available/test
-Include conf/extra/httpd-vhosts.conf +
-# vi /opt/rails/apache2/conf/extra/httpd-vhosts.conf +
-# PHP 파트 +
-<Directory "PHP웹루트디렉토리"> +
-    Options Indexes FollowSymLinks +
-    AllowOverride None +
-    Order allow,deny +
-    Allow from all +
-</Directory>+
 <VirtualHost 아이피주소> <VirtualHost 아이피주소>
-    DocumentRoot PHP웹루트디렉토리 
     ServerName PHP도메인이름     ServerName PHP도메인이름
 +    DocumentRoot PHP웹루트디렉토리
 </VirtualHost> </VirtualHost>
-# Rais 파트 
-<Directory "RAILS웹루트디렉토리"> 
-    Options Indexes FollowSymLinks 
-    AllowOverride None 
-    Order allow,deny 
-    Allow from all 
-</Directory> 
 <VirtualHost 아이피주소> <VirtualHost 아이피주소>
     ServerName RAILS도메인이름     ServerName RAILS도메인이름
 +    DocumentRoot RAILS웹루트디렉토리
 +
     RewriteEngine On     RewriteEngine On
     RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f     RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
줄 154: 줄 103:
     BrowserMatch bMSIE !no-gzip !gzip-only-text/html     BrowserMatch bMSIE !no-gzip !gzip-only-text/html
 </VirtualHost> </VirtualHost>
 +# cd /etc/apache2/sites-enabled
 +# ln -s ../sites-available/test 001-test
 </code> </code>
  
줄 168: 줄 119:
 # mongrel_rails start -d -p 8001 -e production -P log/mongrel-1.pid -c /opt/www/test # mongrel_rails start -d -p 8001 -e production -P log/mongrel-1.pid -c /opt/www/test
 # mongrel_rails start -d -p 8002 -e production -P log/mongrel-2.pid -c /opt/www/test # mongrel_rails start -d -p 8002 -e production -P log/mongrel-2.pid -c /opt/www/test
-# /opt/rails/apache2/bin/apachectl start+# /etc/init.d/apache2 start
 </code> </code>
 이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^ 이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^
줄 195: 줄 146:
 ===== 기타 ===== ===== 기타 =====
 ==== Install lighttpd ==== ==== Install lighttpd ====
-RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, Debian Stable 에 lighttpd 패키지도 존재하지 않는다. 그러므로 별도로 패키지를 받아서 설치해야 한다. 먼저 lighttpd 를 설치하기전에 필요한 패키지부터 설치한다.+RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, Debian Stable 에 lighttpd 패키지도 존재하지 않는다.  
 +그러므로 별도로 패키지를 받아서 설치해야 한다. 먼저 lighttpd 를 설치하기전에 필요한 패키지부터 설치한다.
 <code> <code>
 # apt-get install libpcre3 zlib1g # apt-get install libpcre3 zlib1g
줄 237: 줄 189:
   * [[http://wiki.rubyonrails.com/rails/pages/Lighttpd]]   * [[http://wiki.rubyonrails.com/rails/pages/Lighttpd]]
   * [[http://trac.lighttpd.net/trac/wiki/#ReferenceDocumentation]]   * [[http://trac.lighttpd.net/trac/wiki/#ReferenceDocumentation]]
- 
develop/ruby.txt · 마지막으로 수정됨: 2014/04/10 11:26 저자 starlits