Rvm安装Ruby开发环境

rvm.io官网:
    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.3.3

添加到 .bashrc,(不同操作系统下面路径不一样)
    source  /etc/profile.d/rvm.sh
    source ~/.rvm/scripts/rvm

移除原安装源
    gem sources --remove https://rubygems.org/
添加ruby china源
    gem sources -a https://gems.ruby-china.com
查看源的地址
    gem sources -l
    gem install rails

sudo apt-get install nodejs

gem install passenger
rvmsudo passenger-install-nginx-module  

bundle config 'mirror.https://rubygems.org' 'https://gems.ruby-china.com'

安装pg gem找不到config,请注意postgresql版本路径
    yum install postgresql-devel
    bundle config build.pg --with-pg-config=/usr/pgsql-9.6/bin/pg_config
(用whereis pg_config找文件)
(mac) /Library/PostgreSQL/9.6/bin/pg_config

你可能感兴趣的:(RubyOnRails)