Deploy Rails with Ruby1.9.2 on Redhat4 (1)

分类:OS 2011-08-21 来源:CodeWeblog.com 人气:201

Deploy Rails with Ruby1.9.2 on Redhat4 (1)

1. Install gcc
check the version of gcc on my system.
> Gcc-v
I already had it.

2. Install ruby
from the URL http://www.ruby-lang.org/en/downloads, I download the file ruby-1.9.2-p290.tar.gz
> Tar zxvf ruby-1.9.2-p290.tar.gz
> Cd ruby-1.9.2-p290 /
>. / Configure - prefix = / usr/local/ruby1.9.2
> Make
> Sudo make install
error messages says: carl is not in the sudoers file. This incident will be reported.
solutions:
I need to make user carl sudoers.
> / Usr / sbin / visudo-f / etc / sudoers
# User privilege specification
root ALL = (ALL) ALL
carl ALL = (ALL) ALL

> Sudo make install

add the bin directory to PATH
> Su root
> Vi / etc / profile
PATH = $ PATH: / sbin: / usr / sbin: / usr/local/ruby1.9.2/bin
export PATH
>. / Etc / profile
> Ruby-v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

3. Download and install rubygems
from this URL http://rubyforge.org/projects/rubygems/, I got the file as follow rubygems-1.8.8.tgz
> Tar zxvf rubygems-1.8.8.tgz
> Cd rubygems-1.8.8 /
> Sudo ruby ​​setup.rb

4. Install rails
> Sudo gem install rails - pre - no-ri - no-rdoc
> Rails-v
Rails 3.1.0.rc6
> Sudo gem uninstall rails-v = 3.1.0.rc6
> Sudo gem install rails - pre - no-ri - no-rdoc-v = 3.1.0.rc5
> Rails-v
Rails 3.1.0.rc5

5. Install passenger
download the file from this URL http://files.rubyforge.vm.bytemark.co.uk/passenger/passenger-3.0.8.tar.gz
> Tar xzvf passenger-3.0.8.tar.gz
> Mkdir .. / tools
> Mv passenger-3.0.8 / .. / tools /
> Cd ../tools/passenger-3.0.8 /

put the passenger / bin directory to PATH
> Vi / etc / profile
PATH = $ PATH: / sbin: / usr / sbin: / usr/local/ruby1.9.2/bin: / home/carl/tools/passenger-3.0.8/bin
>. / Etc / profile
> Bin/passenger-install-apache2-module

It asks me to install some softwares:
> Sudo yum install httpd-devel
> Sudo yum install apr-devel
> Sudo yum install apr-util-devel

> Sudo gem install mysql2 or> bundle install
error messages:
/ Usr/local/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb: 368: in `try_do ': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.

solutions:
> Sudo yum groupinstall "Development Tools"
> Sudo yum install ruby-devel
This is not the right solution. I need to install dev-kit. Install the git first, add git to respository
> Sudo rpm-Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
> Sudo yum install git
Installing git is not success.

> Wget http://kernel.org/pub/software/scm/git/git-1.7.6.tar.gz
> Tar zxvf git-1.7.6.tar.gz
> Cd git-1.7.6
>. / Configure - prefix = / usr / local / git
> Make
> Sudo make install
> Git-v

> Git clone git: / / github.com / oneclick / rubyinstaller.git
> Cd rubyinstaller
> Rake devkit sfx = 1
Not success.

> Sudo yum install mysql-devel
> Sudo yum install sqlite sqlite-devel
> Sudo gem install sqlite3-ruby

error messages:
database.c: In function `initialize ':
database.c: 47: error: `SQLITE_OPEN_READWRITE 'undeclared (first use in this function)
database.c: 47: error: (Each undeclared identifier is reported only once
database.c: 47: error: for each function it appears in.)

solutions:
> Sudo gem install sqlite3-ruby-v = 1.2.5

No, it is not helpful.

> Wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
> Tar zxvf sqlite-autoconf-3070701.tar.gz
> Cd sqlite-autoconf-3070701
> Sudo. / Configure - prefix = / usr / tool / sqlite
> Sudo make
> Sudo make install
> Cd / usr / tool / sqlite / bin
> Sqlite3-version
3.3.6

change the Gemfile content to
gem 'sqlite3', '1 .2.5 '

No way out, just comments the line of sqlite3 in Gemfile.

> Rails server
error message:
/ Usr/local/ruby1.9.2/lib/ruby/gems/1.9.1/gems/execjs-1.2.4/lib/execjs/runtimes.rb: 45: in `autodetect ': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS:: RuntimeUnavailable)

> Sudo gem install rake
> Sudo gem install rack
> Sudo gem install fastthread
> Sudo gem install execjs
> Sudo gem install therubyracer
> Sudo gem install - no-ri - no-rdoc therubyracer
> Sudo gem install libv8
# # #> Gem install johnson
> Sudo gem install daemon_controller
> Sudo gem install pcre-devel

try to go with passenger> passenger start
error messages:
error: unrecognized command line option "-Wno-missing-field-initializers"
solutions:
upgrade gcc on redhat4
> Wget http://ftp.gnu.org/pub/pub/gnu/gcc/gcc-4.2.0/gcc-4.2.0.tar.bz2
> Tar jxf gcc-4.2.0.tar.bz2
> Sudo mkdir / usr/gcc4
> Cd gcc-4.2.0
>. / Configure - prefix = / usr/gcc4
> Make clean
> Make
> Make check
> Sudo make install
> Sudo mv / usr / bin / gcc / usr / bin / gcc.bak
> Sudo ln-sv / usr/gcc4/bin/gcc / usr / bin / gcc
> Sudo mv / usr / bin / cpp / usr/bin/cpp3
> Sudo mv / usr / bin / g + + / usr / bin / g + +. Bak
> Sudo ln-s / usr/gcc4/bin/g + + / usr / bin / g + +
> Sudo mv / usr / bin / gcov / usr / bin / gcov.bak
> Sudo ln-s / usr/gcc4/bin/gcov / usr / bin / gcov
> Sudo mv / usr / bin / c + + / usr / bin / c + +. Bak
> Sudo ln-s / usr/gcc4/bin/c + + / usr / bin / c + +
> Sudo mv / usr / bin / cpp / usr / bin / cpp.bak
> Sudo ln-s / usr/gcc4/bin/cpp / usr / bin / cpp

error messages:
Could not start Passenger Nginx core:
/ Home/carl/.passenger/standalone/3.0.8-x86-ruby1.9.2-linux-gcc3.4.6-1002/nginx-1
.0.5/sbin/nginx: / Usr / lib / libstdc + +. So.6: version `GLIBCXX_3.4.9 'not found
(Required by
solutions:
> Sudo mv / usr / lib / libstdc + +. So.6 / usr / lib / libstdc + +. So.6.bak
> Sudo ln-s / usr/gcc4/lib/libstdc + +. So.6 / usr / lib / libstdc + +. So.6
It works.

update the yum and install curl
> Sudo yum update
> Sudo yum install curl curl-devel

try to install rvm
# # #> Bash <<(curl-sk https://rvm.beginrescueend.com/install/rvm)
# # #> Echo '[[-s "$ HOME / .rvm / scripts / rvm"]] & &. "$ HOME / .rvm / scripts / rvm" # Load RVM function'>> ~ /. Bash_profile
# # #> Source ~ /. Bash_profile
> Curl-k https://rvm.beginrescueend.com/install/rvm-o rvm-installer
> Chmod + x rvm-installer
> Rvm_bin_path = ~ / .rvm / bin rvm_man_path = ~ / .rvm / share / man. / Rvm-installer

It is not working for me to install rvm on redhat4.

> Vi Gemfile
gem 'therubyracer', '> = 0.8.2'
gem 'therubyracer-heroku'
> Bundle exec rake-T

> Git clone https://github.com/fractaloop/libv8.git

messages:
error: SSL certificate problem, verify that the CA cert is OK. Details:
error: 14090086: SSL routines: SSL3_GET_SERVER_CERTIFICATE: certificate verify failed while accessing https://github.com/fractaloop/libv8.git/info/refs

> Env GIT_SSL_NO_VERIFY = true git clone https://github.com/fractaloop/libv8.git
> Cd libv8
> Env GIT_SSL_NO_VERIFY = true git submodule update - init
> Bundle install
> Bundle exec rake compile

Finally, I can not run> passenger start and> rails server on my virtualbox redhat4 machine. I will try the rails_mod next.
Other problems are solved, all of the 2 command report this kind of error message at the end.
[Pid = 2900 thr = 82891570 file = utils.rb: 176 time = 2011-08-21 11:57:44.100]: *** Exception PhusionPassenger:: UnknownError in PhusionPassenger:: Rack:: ApplicationSpawner (Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS:: RuntimeUnavailable)) (process 2900, thread # <Thread:0x9e1a664>):

references:
http://sillycat.iteye.com/blog/562613
http://sillycat.iteye.com/blog/562615
http://sillycat.iteye.com/blog/562617
http://sillycat.iteye.com/blog/562618
http://www.modrails.com/install.html
http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
http://www.freshblurbs.com/installing-ruby-rails-3-centos-nginx
http://hi.baidu.com/addcn/blog/item/eac5c094e5a22b43d0135e84.html
http://railsapps.github.com/installing-rails-3-1.html
http://wuhuizhong.iteye.com/blog/1106968

分享到:
blog comments powered by Disqus

相关文章

  • Environment variable profile path in MAC OS X 2010-03-07

    ~ /. Bash_profile OR ~ /. Profile

  • tar command batch extract Methods [change] 2010-09-05

    Since the tar command does not support linux batch extract, many users write a lot of support for Batch extract the shell commands, collect a bit for people to share: First: for tar in *. tar.gz; do tar xvf $ tar; done for tar in *. tar.bz2; do tar xvf $

  • ruby installation & eclipse plug-in installed 2010-11-15

    1.1 Installing Ruby One-Click Installer, the download page http://www.ruby-lang.org/en/downloads/ 1.2 Installing Rails, Windows CMD (Start - "Run -> cmd) to run" gem install rails - include-dependencies ", automatically installed. e

  • mysql export just the table structure 2010-11-09

    The first window into the installation by running the mysql server's bin directory. Export the entire database table structure is as follows: mysqldump-uroot-p-d databasename> createtab.sql If you want to export the table test1, test2, test3 t

  • centos mysql and memcached integration under 2010-04-14

    A successful installation of the software list mysql-5.1.43-linux-x86_64-icc-glibc23.tar.gz libvent-1.4.7-stable.tar.gz memcached-1.2.6.tar.gz libmemcached-0.26.tar.gz memcached_functions_mysql_1.0.tar.gz Second, the installation steps Login to root throu

  • Custom Install MySQL 2010-08-25

    Custom Install MySQL (mysql-max-5.0.27-linux-i686-glibc23) 2007-10-11 03:56 PM shell> groupadd mysql shell> useradd-g mysql mysql shell> cd / usr / local shell> tar-xzvf mysql-max-5.0.27-linux-i686-glibc23.tar.gz shell> ln-s mysql-max-

  • Red5 installation and configuration 2011-02-24

    Red5 installation and configuration reference page: http://www.cahblog.com/?p=709 http://dev.firnow.com/course/6_system/linux/Linuxjs/20100604/207839.html A, Red5 Profile Red5 is an open source Java development using Flash streaming media server. It suppo

  • Common abnormalities resolved 2011-09-18

    ConcurrentHashMap and CopyOnWriteArrayList comparison. Blog categories: Java ConcurrentHashMap ConcurrentHashMap introduced Segment, each Segment is a hashtable, the equivalent of two Hash table, and then lock in the Segment level, and increased concurren

  • tomcat 5.0 + apache 2.0 完全安装步骤详解 2014-11-03

    Apache httpd-2.0.47 + Tomcat jakarta-tomcat-4.1.24 + jk2 + php-4.3.3 的安装: 服务器环境: RedHat Linux 8.0 J2sdk1.4.1_02 Tomcat 4.1.12 binary Apache 2.0.47 built from source jk2 connector source from jakarta.apache.org 安装JDK: 下载: j2sdk-1_4_1_02-linux-i586.bin

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.259 (s). 14 q(s)