Skip to content

Instantly share code, notes, and snippets.

@yiquncode
Last active December 15, 2015 06:59
Show Gist options
  • Save yiquncode/5220308 to your computer and use it in GitHub Desktop.
Save yiquncode/5220308 to your computer and use it in GitHub Desktop.
rails基础分享,环境部署。
#对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境是个是棘手的问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境。
#解决包的依赖关系
sudo yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
sudo yum install -y wget
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -ivh epel-release-5-4.noarch.rpm
sudo yum install -y readline* libyaml* libffi* libtool* bison* libxslt*
#安装RVM
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
sudo yum -y install patch
#安装RUBY
rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
gem source -r https://rubygems.org/
gem source -a http://ruby.taobao.org
#安装RAILS
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
gem install bundler rails
#然后测试安装是否正确
$ bundle -v
Bundler version 1.3.4
$ rails -v
Rails 3.2.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment