- 浏览: 2542628 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
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
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
发表评论
-
Docker(4)Docker on Raspberry
2015-07-15 13:25 1099Docker(4)Docker on Raspberry I ... -
VirtualBox Network
2015-06-10 11:48 774VirtualBox Network Last one ye ... -
Debian System(1)Java and NodeJS Env
2015-03-29 06:27 1027Debian System(1)Java and NodeJS ... -
VirtualBox Importing OVA
2014-05-14 03:35 1222VirtualBox Importing OVAJust im ... -
Data Import Process
2012-09-05 11:21 1254Data Import Process 1. prepare ... -
Artifactory on Linux(1)
2011-12-13 22:41 1383Artifactory on Linux(1) Downlo ... -
Hudson/Jenkins Installation on Redhat4
2011-12-13 22:40 1351Hudson/Jenkins Installation on ... -
Archiva In Linux(1)
2011-12-13 13:56 1574Archiva In Linux(1) 1. install ... -
kingate(1)Install on redhat4
2011-11-02 23:02 1344kingate(1)Install on redhat4 1 ... -
JBOSS Performance Tuning
2011-09-22 16:20 1824JBOSS Performance Tuning 2. JV ... -
Linux Deploy Rails3 with Ruby1.9.2(5)Fix the Error Messages
2011-09-03 11:12 751Linux Deploy Rails3 with Ruby1. ... -
Linux Deploy Rails3 with Ruby1.9.2(4)Configure the rails in Apache2
2011-09-03 11:11 1605Linux Deploy Rails3 with Ruby1. ... -
Yum Problem after Python Upgrade
2011-08-23 17:09 4122Yum Problem after Python Upgrad ... -
Linux Deploy Rails3 with Ruby1.9.2(3)
2011-08-23 14:27 2205Linux Deploy Rails3 with Ruby1. ... -
Linux Deploy Rails3 with Ruby1.9.2(2)
2011-08-21 17:00 1670Linux Deploy Rails3 with Ruby1. ... -
Yum on Linux System
2011-08-20 14:00 1241Yum on Linux System download t ... -
Understand the Linux Version
2011-08-20 10:35 1428Understand the Linux Version 1 ... -
Linux Commands(I) scp
2011-06-21 23:54 1266Linux Commands(I) scp 1. scp i ... -
Linux Server Deployment(II)apache and SSH-CVS
2011-06-08 22:04 1611Linux Server Deployment(II)apac ... -
Linux Server Deployment(I)cvs and iptables
2011-06-08 22:03 1699Linux Server Deployment(I)cvs a ...
相关推荐
Rails 经典开发参考书, Ruby on rails 系近年来在西方日渐盛行的一套网页开发工具,其高度集成化时开发时间大大缩短.
Ruby on Rails offers a robust platform for agile web development, combining powerful features with a philosophy that prioritizes developer productivity and application maintainability. Whether you’re...
Rails是Ruby on Rails的简称,是一个流行的开源Web开发框架,用于构建动态、数据驱动的网站。部署Rails应用通常涉及将本地开发环境中的代码推送到远程服务器,并配置合适的Web服务器以处理HTTP请求。 在Rails部署...
Many former Java developers still use Ruby on Rails today, the most popular framework for building Ruby applications. What You'll Learn What are the fundamentals of Ruby and its object-oriented ...
Preparing to Deploy NSX with Britton Johnson (@vcixnv) and Aaron Bolthouse (@Bhouse563) [720p].mp4Preparing to Deploy NSX with Britton Johnson (@vcixnv) and Aaron Bolthouse (@Bhouse563) [720p].mp4
自述文件 ...cd e5-deploy-with-docker-rails-api-single-node # edit docker-compose.yml to set the mysql & rails ports to be mapped on host docker-compose build bin/d_rails db:migrate bin/d
Deploy Your First Deep Learning Model On Kubernetes With P
The new edition of this book provides the same excellent introduction to Ruby as the first edition plus updates for the newest version of Ruby, including the addition of the Sinatra and Ramaze web ...
Ansible-rails-deploy.zip,Ansible脚本,用于设置完全加载的Ruby/Rails Web服务器Rails部署,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
您可能需要按照以下步骤将 ruby on rails 应用程序部署到 Ubuntu + Nginx + Unicorn 环境。 在这里,我将 RVM 安装为多用户模式。 我使用www-data用户来运行我的应用程序(这是 Ubuntu 上 Apache 和 Nginx 的...
标题中的 "[Deployer:149026]Deploy application WebContent on myserver" 提示我们这是一项关于部署Web应用程序的活动,其中“Deployer:149026”可能是一个特定部署工具或进程的标识符,而“myserver”指的是目标...
Despite its great popularity, Docker is still a fairly new project, with many peo- ple still not really knowing exactly what Docker is. If you are one of those people, this book can help you take that...
在Ruby世界中,Ruby on Rails(RoR)是一种流行的开源框架,用于构建高效、优雅的Web应用程序。Ansible则是一个自动化运维工具,可以帮助我们轻松地配置、部署和管理服务器,尤其是对于Ruby on Rails应用的部署而言...
deploy_container_with_gpu.sh
Acronis Snap Deploy Management 是一款高效的企业级工具,专门用于快速、批量地部署Linux操作系统到多台设备上。它利用Acronis先进的磁盘映像技术,能够在保持原有系统完整性的基础上,创建一个包括操作系统、配置...