Skip to content

Instantly share code, notes, and snippets.

@iannono
Last active December 14, 2015 03:39
Show Gist options
  • Save iannono/5023094 to your computer and use it in GitHub Desktop.
Save iannono/5023094 to your computer and use it in GitHub Desktop.
rails env install guide
# this guide is based on http://ruby-china.org/wiki/install_ruby_guide and linuxmint
# -------what'new-----
# fixed some bug
# add solution for common errors
# 2013-10-17
# install sqlite3
sudo apt-get install libsqlite3-dev
# 2013-8-15
#install nokogiri
sudo apt-get install libxslt libxml2-dev
# 2013 -7 -28
recommend to install ruby with rbenv
#custom bash
export ps1="\e[0;32m^_^\u\e[m\e[0;34m \W \$ \e[m"
# 2013-7-24
# now can use these code to auto update ruby requirements
rvm get head
rvm autolibs enable
# when could not get lock /var/lib/apt/lists/lock -open
# then
sudo rm /var/lib/apt/lists/lock
rvm requirements
rvm reinstall all
sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
sed -i.bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
rvm install 1.9.3 -C --with-openssl-dir=$rvm_path/usr --with-iconv-dir=$rvm_path/usr --with-readline-dir=$rvm_path/usr
rvm 1.9.3 --default
gem source -r http://rubygems.org/
gem source -a http://ruby.taobao.org
# check ruby and rvm version
ruby -v
gem -v
# Tips
sudo apt-get remove autoconf(# when `Error running 'autoreconf -is --force')
sudo apt-get purge autoconf
rvm pkg install readline
sudo aptitude install libreadline-dev(# when cannot load such file -- readline)
rvm pkg install zlib(#when cant read --zlib)
rvm pkg install openssl
rvm pkg install iconv
gem install rdoc(# when file 'lib' not found)
gem install bundler rails -N
bundle -v
rails -v
sudo apt-get install node(# when 'Could not find a JavaScript runtime' )
sudo apt-get install libpq-dev(#when error installing pg)
sudo aptitude install <packagename>(# when met depences problem)
# git tips
sudo apt-get install git-core
ssh-keygen -t rsa -C "mail_address"
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
ssh -T [email protected]
# when Error: Agent admitted failure to sign
ssh-add
sudo aptitude install ack-grep(#http://betterthangrep.com/)
sudo ln -s `which ack-grep` /bin/ack
# Can't find the PostgreSQL client library (libpq)
# mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm
# then gem install pg
# and then mv ~/.rvm/usr/lib_rvm ~/.rvm/usr/lib
sudo apt-get install postgresql
sudo apt-get install libpq-dev
Then
gem install pg
then
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment