- 浏览: 849352 次
- 性别:
- 来自: lanzhou
文章分类
最新评论
-
liu346435400:
楼主讲了实话啊,中国程序员的现状,也是只见中国程序员拼死拼活的 ...
中国的程序员为什么这么辛苦 -
qw8226718:
国内ASP.NET下功能比较完善,优化比较好的Spacebui ...
国内外开源sns源码大全 -
dotjar:
敢问兰州的大哥,Prism 现在在12.04LTS上可用么?我 ...
最佳 Ubuntu 下 WebQQ 聊天体验 -
coralsea:
兄弟,卫星通信不是这么简单的,单向接收卫星广播信号不需要太大的 ...
Google 上网 -
txin0814:
我成功安装chrome frame后 在IE地址栏前加上cf: ...
IE中使用Google Chrome Frame运行HTML 5
Note: Since this post originally went up, some of the packages have changed/updated. I’ve kept things pretty well up-to-date, but you might want to double check the latest versions and alter the bash commands accordingly. Be aware that as of this writing, the Ruby team has made 1.9.1 the latest stable and only Rails itself is deemed compatible with Ruby 1.9x. I.e., Rails passes all its own tests on 1.9.1, but most plugins, libraries, etc are likely to give you problems right now. So your best bet is to use 1.8.7 for awhile until your favorite libraries jump on board the 1.9 wagon. –Trevor (August 17, 2009)
I recently had to roll a new VM for work in order to run Rails and Sinatra apps on Apache/Passenger . My company favors CentOS as the default distro for all our boxes, so I wasn’t able to use all the super-up-to-date packages that Ubuntu makes available, and I ended up building everything from source. For posterity and for anyone else who needs it, here’s a list of what to do and how to do it.
Dependencies
You’ll need several libraries and the MySQL server, and you can use yum to install them all at once. This set includes the gcc compiler, the gcc-c++ compiler, and the zlib development headers for Ruby. Remember: not all libraries are the same — you’re going to need to make sure that you’re compiling Ruby w/ 32 or 64-bit development headers as appropriate for your architecture.
1
2 3 4 5 6 7 8 9 10 |
sudo yum install httpd-devel\
openssl-devel\ zlib-devel\ gcc\ gcc-c++\ curl-devel\ expat-devel\ gettext-devel\ mysql-server\ mysql-devel |
Ruby
Next up is Ruby. We’ll install 1.8.7-p72, the latest stable as of this writing. First, we’ll make a “src” directory in /usr/local to hold everything:
1
2 3 4 5 6 7 8 |
sudo mkdir /usr/local/src
cd /usr/local/src sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz sudo tar xzvf ruby-1.8.7-p72.tar.gz cd ruby-1.8.7-p72 sudo ./configure --enable-shared --enable-pthread sudo make sudo make install |
Ok now for a weird thing — you need to remake and re-install Ruby after using it to run a script that helps you make a new makefile. This is so that you can tell it where the zlib headers live:
1
2 3 4 5 |
cd ext/zlib
ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib cd ../../ sudo make sudo make install |
After all that happens, you should have Ruby installed. Check and see by doing:
1
|
ruby --version
|
You should see something like:
1
|
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
|
Rubygems
Now that you have Ruby installed, Rubygems is easy — the whole thing is in Ruby so there’s nothing to build/compile.
1
2 3 4 5 |
cd /usr/local/src
sudo wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz sudo tar xzvf rubygems-1.3.5.tgz cd rubygems-1.3.5.tgz sudo ruby setup.rb |
Rails, Passenger, MySQL and Sinatra
Now that Ruby and Rubygems are installed, you can install Rails, Passenger, and Sinatra as gems:
1
|
sudo gem install rails passenger sinatra
|
That will take awhile, as there’s a ton of documentation to build for Rails, and Passenger has to compile some native extensions.
Once that’s done, finish the Passenger installation with their nifty installer tool:
1
|
sudo passenger-install-apache2-module
|
Follow the provided instructions at the end of the installer for adding lines to httpd.conf:
1
2 3 |
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6 PassengerRuby /usr/local/bin/ruby |
After that, install the MySQL gem, making sure to specify where the config is:
1
|
sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
|
Disabling SEL inux
The RedHat family of distros (RHEL, CentOS, Fedora) come with SEL inux enabled by default. If you want to learn how to make it work with Passenger, you can try this tip from the Passenger user’s guide. I just turned it off because the box is only going to be used for these apps, and SEL inux seems like overkill. Here’s how to shut it down:
First, disable it temporarily:
1
|
sudo echo 0 >/selinux/enforce
|
That’s not a permanent fix though, because the next time the server boots, it’ll be turned back on again. You need to edit the config file and turn it off. Open it with your favorite editor and change one line. You need to be root or running as sudo to edit this file, and I prefer Vim when on remote servers, so it’s:
1
|
sudo vim /etc/sysconfig/selinux
|
Change this:
1
|
SELINUX=enforcing
|
to this:
1
|
SELINUX=disabled
|
Restart Apache
You should be able to restart Apache now and have Passenger come up no problem. There are several ways to restart Apache, but I like to use the service way to keep it simple:
1
|
sudo /sbin/service httpd restart
|
Optional: Installing Git
For SCM, there are a lot of reasons why I like Git better than Subversion. It’s got a bit of a learning curve, but once you go Git, you never go back.
1
2 3 4 5 6 |
cd /usr/local/src
curl -O http://www.kernel.org/pub/software/scm/git/git-1.6.0.4.tar.gz tar zxf git-1.6.0.4.tar.gz cd git-1.6.0.4.tar.gz sudo make all sudo make install |
And the man pages:
1
2 3 4 |
cd /usr/local/src
curl -O http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.0.4.tar.gz cd /usr/local/share/man tar -zxf /usr/local/src/git-manpages-1.6.0.4.tar.gz |
Now you should have Git installed and ready. Prove it:
1
|
git --version
|
You should see something like:
1
|
git version 1.6.0.4
|
And that’s it — you now have a full Ruby stack ready to go on CentOS 5. Much of this tutorial was adapted from the awesome Hivelogic post on installing the stack on OS X Leopard.
发表评论
-
Rails 3 Beta版本月将出 Merb融合带来选择
2010-01-11 09:48 1419Rails 3,目前流行Web开发框架Rails的一个升级版 ... -
MerbAdmin:Merb数据管理好帮手
2010-01-11 09:43 907Merb中要加入类似Django的Admin功能早有传闻,如今 ... -
rails cms
2009-12-28 20:29 1668Rails CMS alternatives ======= ... -
Generating Thousands of PDFs on EC2 with Ruby
2009-12-24 18:01 1038The Problem For about two mont ... -
Shrink your JavaScript with the Google Compiler Rails Plugin
2009-11-16 11:27 933Like it or not, JavaScript has ... -
Thank you, Rails
2009-11-06 18:21 566It’s fashionable, or perhaps in ... -
Top 50 Ruby on Rails Websites
2009-10-31 15:18 943We’re big fans of Ruby on Rails ... -
Let a human test your app, not (just) unit tests
2009-10-31 09:26 852I’m a big believer in unit test ... -
Heroku Gets Add-Ons: Serious Ruby Webapp Hosting Made Easy
2009-10-30 07:37 912Heroku is a Ruby webapp hosti ... -
Rails + Google Analytics = easy goal tracking
2009-10-29 20:38 891Google Analytics is an indis ... -
Integrating Flickr into your rails website
2009-10-29 20:37 1066In this post I’m going to show ... -
Ruby on Rails Roadshow in Austin Thursday
2009-10-29 14:25 808Justin Britten founded Prefine ... -
Ruby on Rails and the importance of being stupid
2009-10-21 08:13 805A tale of two servers… Server ... -
How a 1-Engineer Rails Site Scaled to 10 Million Requests Per Day
2009-10-20 14:49 774Ravelry is an online knitting ... -
CentOS配置lighttpd和rails
2009-10-20 14:22 1121lighttpd版本:1.4.18 fastcgi版本: ... -
Cells:将组件开发带入Ruby2.3
2009-10-20 09:17 1117cells "将使得面向组 ... -
High Quality Ruby on Rails Example Applications
2009-10-15 16:34 1459Sometimes to best way to get ... -
Install Passenger on Ubuntu
2009-10-07 10:17 805Phusion Passenger is one of the ... -
Installing Ruby on Rails with Apache on Ubuntu 9.04 (Jaunty)
2009-10-07 10:00 1013Installing Passenger and Depe ... -
Ruby on Rails with Nginx on Ubuntu 9.04 (Jaunty)
2009-10-07 09:57 1065Install Required Packages ...
相关推荐
Ruby on Rails is the revolutionary online programming tool that makes creating functional e-commerce web sites faster and easier than ever. With the intuitive, straightforward nature of Ruby and the ...
本篇将基于提供的文档摘要,深入解析安装Oracle RAC on AIX的关键步骤与注意事项,为读者提供一份详尽的操作指南。 ### 安装准备阶段 #### 1. 下载并解压安装介质 首先,需要从Oracle官方网站的edelivery服务下载...
- Installing Rails on Windows requires setting up Ruby, installing gems like `bundler`, and configuring the environment. Developers often use tools like RubyInstaller and DevKit for Windows. 2. **...
Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems...
Microsoft Windows 2000 Scripting Guide - Installing Software on a Remote Computer
执行命令`gem install rails -y`即可一键安装Rails及其所有依赖包。例如: ```bash gem install rails -y ``` 安装完成后,可以使用`gem list`命令查看已安装的所有gem包。 通过上述步骤,不仅能够实现Ruby的定制...
标题与描述均提到了“ruby on rails安装环境”,这表明文档主要关注的是如何在特定的环境中设置Ruby on Rails。Ruby on Rails(常简称为Rails)是一种用于开发Web应用程序的开源框架,采用Ruby语言编写,遵循MVC...
Installing Your Driver on Windows Millennium INF File Guide
根据提供的文档信息,本文将详细解析安装 Oracle RAC (Real Application Clusters) 在 AIX 操作系统上的步骤、注意事项及关键技术点。 ### 安装前准备 #### 下载安装介质与补丁集 ... - 示例文件包括:`B24442-01_1...
在IT领域,将一款设备刷入不同的操作系统或定制ROM是一种常见的技术操作,它允许用户根据个人喜好和需求自定义手机的界面与功能。本篇内容将深入解析如何在魅族MX2上安装MIUI系统,这是一项对于Android发烧友而言极...
### 安装Oracle 10g R2在RHEL 5 & OEL 5 (x86_64)上的需求 #### 概述 本文档详细介绍了在Red Hat Enterprise Linux(RHEL)5和Oracle Enterprise Linux(OEL)5(x86_64架构)上安装Oracle 10g Release 2数据库的...
面是我在Ubuntu6.06 LTS 下源码编译安装samba主要安装过程,本人第一次用Ubuntu,刚装上去时候,没有gcc编译环境。郁闷了半天。找出这一过程发了不少的时间。可能还有些不妥,不过我经过这样的安装达到了向windows共享...
5. **等待安装完成**:安装过程可能需要几分钟时间,请耐心等待直至安装完成。 #### 六、验证安装结果 为了确保安装成功,可以在终端中运行以下命令检查Anaconda的版本信息: ``` conda --version ``` 如果安装...
### 安装Activ Test软件至个人电脑的知识点详解 #### 一、背景介绍 随着信息技术的发展,越来越多的专业技能认证考试采用计算机化的方式进行。其中,ECDL(欧洲计算机驾驶执照)作为一项广泛认可的计算机操作技能...
cat install.log | grep Installing | sed 's/Installing//g' > /home/packages.list ``` #### 五、完整性检查与打包 1. **完整性检查**: - 完成所有文件和 RPM 包的复制后,需确保 `/home/OS/CentOS` 目录下的...
2.4.1. General Notes on Installing MySQL on Mac OS X 2.4.2. Installing MySQL on Mac OS X Using Native Packages 2.4.3. Installing the MySQL Startup Item 2.4.4. Installing and Using the MySQL Preference...
1、已安装的linux (以centos7为例) 2、离线安装包: ①、docker-engine-1.7.1-1.el7.centos.x86_64.rpm(可从以下链接下载http://www.oschina.net/news/64267/docker-1-7-1-final,centos7对应下载链接: ...