Deploy Rails with Ruby1.9.2 on Redhat4 (1)

sponsored links
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
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Deploy Rails with Ruby1.9.2 on Redhat4 (1)

  • Rails source code analysis (1): RailsFCGIHandler

    In accordance with the sequence starting from the beginning CGI Ruby CGI Doc: The Common Gateway Interface ( CGI ) Is a simple protocol for passing an HTTP request from a web server to a standalone program, and returning the output to the web browser ...

  • Rails source code analysis (4): Request / Response

    1) Rails defines two abstract class: AbstractRequest and AbstractResponse code is not posted, first take a look at Response. 2) is mainly responsible for the specific ctgi_process.rb main interface is responsible for implementation methods of impleme ...

  • flash chart summary

    pen Flash Chart is an open source Flash chart drawing tool, offers a variety of programming interfaces, including PHP, Ruby, Perl, Python, Java,. Net, AS, JS, etc. to generate a variety of data interfaces, and then Flash to display the function is to ...

  • Rails2.0.2 change the default DB adpter

    In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra ...

  • RSpec troubleshooting

    1.uninitialized constant Dependencies Conditions: In windows under way to install the RSpec gem and rspec-rails. However, in ruby script / spec_server to do the test under the spec your_spec.rb-X will appear uninitialized constant Dependencies (NameE ...

  • Alternative to Java with Ruby to do unit testing interface rest!

    Ruby is long overdue to replace java more flexible and make some necessary changes in a matter of, if not deep-rooted culture of the company's java, I think. . . . . . The following are my Writing for the Rest of the interface used to make the test su

  • Workspace run under different Eclipse

    Now do live more and more often required to use eclipse in java and ruby & rails project conducted between the tangential shear from the past, because in the rails project used a coloring Aptana preferences, the results open the java project sour ...

  • hibernate (jpa) composite primary key annotation statement Ways

    In the design of the database tables are designed with a composite primary key of the table, that table's record by more than one field joint identification, such as: Table CREATE TABLE TB_HOUR_DATA ( STAT_DATE DATE NOT NULL, PATH_ID NUMBER(20) NOT NULL,

  • Oracle instant clent for ruby / rails on cygwin

    Environment: XP: oracle full client, ruby, rails, gem cygwin: ruby rails, gem (the version with the XP version) Needs: for cygwin is installed under the rails platform support oci Steps: <1> download oracle instant client (10.2.0.3 Instant Client Pa

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries