• 在 Ubuntu 12.04 上安装 RVM 和 Ruby


    前言

    使用RVM来管理Ruby,建议使用同样的 Ubuntu 版本,以免遇到一些版本不同带来的问题。

    参考

    http://ruby-china.org/wiki/install-rails-on-ubuntu-12-04-server

    配置 Ubuntu 系统

    如果你是国内服务器,推荐修改网易的源

    1. 输入 sudo vi /etc/apt/sources.list 将里面的内容替换成:
      deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
      deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
      deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
      deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
      deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
      deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
      deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
      deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
      deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
      deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
    2. 然后更新一下:
      sudo apt-get update
    3. 安装必要的三方库

       sudo apt-get install -y wget vim build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev libcurl4-openssl-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev nodejs libpq-dev

    安装 Ruby

    安装 RVM

    $ curl -L https://get.rvm.io | bash -s stable
    $ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >>~/.bashrc
    $ source ~/.bashrc
    $ rvm -v

    安装 Ruby

    如果你是国内服务器,推荐将 RVM 的安装源替换成 Taobao 的镜像服务器,这样安装能更快!

     sed -i -e 's/ftp.ruby-lang.org/pub/ruby/ruby.taobao.org/mirrors/ruby/g' ~/.rvm/config/db

    用 RVM 安装 Ruby:

    $ rvm pkg install readline openssl
    $ rvm install 2.0.0
    $ rvm use 2.0.0 --default
    $ ruby -v
    ruby 2.0.0p247
     

    国内服务器推荐替换 RubyGems 的到淘宝镜像:

    $ gem sources --remove https://rubygems.org/
    $ gem sources -a http://ruby.taobao.org/
    $ gem sources -l
    *** CURRENT SOURCES ***
    
    http://ruby.taobao.org
     
  • 相关阅读:
    Redis集群的搭建
    CAS部署在Windows上
    Loadrunner中Error-26612HTTP Status-Cod
    Coneroller执行时候的-26374及-26377错误
    Loadrunner 26377错误
    歌名也好笑
    loadrunner 中Error和failed transaction 的区别
    loadrunner 性能测试报error-27796的解决
    lr11.0负载测试 real-world schedule 与basic schedule的区别是什么
    LR中错误代号为27796的一个解决方法
  • 原文地址:https://www.cnblogs.com/dearmark/p/3471928.html
Copyright © 2020-2023  润新知