首页 > 系统服务 > 详细

Ubuntu Install Rbenv & Ruby & Rails (Week I)

时间:2015-09-19 10:49:49      阅读:298      评论:0      收藏:0      [点我收藏+]

Advanced Software Engineering

The First Class

Part I

1 Install Essential Dependecies

  1. sudo apt-get update
  2. sudo apt-get install -y build-essential openssl curl libcurl3-dev libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev

2 Install Rbenv Environment

  1. git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
  2. echo ‘export PATH="$HOME/.rbenv/bin:$PATH"‘ >> ~/.bashrc
  3. echo ‘eval "$(rbenv init -)"‘ >> ~/.bashrc
  4. source ~/.bashrc
  5. type rbenv
  6. git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

3 Install Ruby Environment

      List all version of ruby, and then you can chose one to install

  1. rbenv install -l
  2. rbenv install 1.9.3-p448

4 Set up Ruby Version and Change Gem Source

  1. rbenv global 1.9.3-p448  # accroding to the former one
  2. rbenv rehash
  3. gem sources --remove https://rubygems.org/
  4. gem sources -a http://ruby.taobao.org/

5 Install Rails

  1. gem install bundler rails

6 Check the Version

  1. ruby -v
  2. gem -v
  3. rake -V
  4. rails –v

      技术分享

7 Install node.js

  1. sudo add-apt-repository ppa:chris-lea/node.js
  2. sudo apt-get update
  3. sudo apt-get install nodejs

8 Test the Environment

  1. cd ~
  2. mkdir rails
  3. cd rails
  4. rails new blog
  5. 技术分享
  6. cd blog
  7. rails server
  8. 技术分享
  9. http://127.0.0.1:3000
  10. 技术分享

9 Complete

Ubuntu Install Rbenv & Ruby & Rails (Week I)

原文:http://www.cnblogs.com/moonseazj/p/4821018.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!