Deploy Rails with Ruby1.9.2 on Redhat4 (1)

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

分类:OS 时间:2011-08-21 人气:201
分享到:
blog comments powered by Disqus

相关文章

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

    ~ /. Bash_profile OR ~ /. Profile

  • tar使用--exclude参数遇到的问题. 2013-05-08

    我们在使用tar的时候,有时候需要排除要压缩的目录下某个子目录,这时候,我们需要使用--exclude,但是我们遇到了一个问题,就是它和要压缩的目录相对路径和绝对路径选择问题.例如: [root@nanhuang ~]# tar cvzf aa.tar.gz --exclude=/root/scripts/yum scripts 要压缩的目录scripts是相对路径,而--exclude使用的是绝对路径.则结果不能成功排除yum子目录. 解决的办法是: 如果要压缩的目录是相对路径.排除的子目录必

  • Ruby Web access speed to enhance effective method 2010-11-04

    Viila2.0 initial on-line access to an incredible slow road to open a futures can be dragged over the details of Lara 1 minute. 3 days in my efforts, and eventually upgrade to the present from 9989ms 727ms. And share with you, we recommend skeptical c

  • 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. eclips

  • 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 table st

  • 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 conc

  • 绿色版Solr安装配置 2013-10-30

    由于Solr可以用Tomcat运行的,而Tomcat是用JDK运行的,可以利用JDK免安装的特点实现Solr的免安装.就是通过配置整合JDK.Tomcat.Solr,实现一次配置好后,打包成tar包,就可以方便在其他服务器部署. 前期准备,先到网上下载好jdk,tomcat,solr.下面使用jdk-7u45-linux-x64.tar.gz, apache-tomcat-7.0.42.tar.gz, solr-4.5.0.tgz, zookeeper-3.4.5.tar.gz进行介绍. 解压下

  • linux安装jdk7 2014-06-06

    1.创建java安装目录 # cd usr/ # mkdir java 2.tar安装 # tar xzvf jdk-7u60-linux-x64.gz 3.配置环境变量 在etc/profile文件下添加 export JAVA_HOME=/usr/java/jdk1.7.0_60 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOM

  • NetBeans6.8 configuration C / C + + development environment (Windows) 2010-03-28

    Recent study C, VC + + was found too inflexible, and mostly spent too much time writing code. Has been used for Eclipse, a lot of keyboard shortcuts, all of a sudden everything by hand, not used to. Previously been configured in the Eclipse C / C + +

  • In solaris10 install jdk + tomcat 2010-06-18

    This relatively simple, the JDK from sun solaris download page to obtain the JDK, From here, http://java.sun.com/javase/downloads/index.jsp , Select solaris SPARC platform, download the jdk-*- sparc.sh. The server running the sh, first appeared User

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

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

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

processed in 0.378 (s). 12 q(s)