sh rbenv在Ubuntu 14.04 LTS上安装ruby 2.3.0

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh rbenv在Ubuntu 14.04 LTS上安装ruby 2.3.0相关的知识,希望对你有一定的参考价值。

#
# Run as root
# $ bash <(curl -s https://raw.github.com/gist/1631411)
#

# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
                   libssl-dev \
                   libyaml-dev \
                   libsqlite3-dev \
                   libreadline-dev \
                   zlib1g zlib1g-dev \
                   libmysqlclient-dev \
                   libcurl4-openssl-dev \
                   libxslt-dev libxml2-dev

# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv

# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh

chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh

# Install ruby-build:
pushd /tmp
  git clone git://github.com/sstephenson/ruby-build.git
  cd ruby-build
  ./install.sh
popd

# Install Ruby 2.3.0:
rbenv install  2.3.0
rbenv global   2.3.0

# Rehash:
rbenv rehash

# Install bundler
gem update --system
gem install bundler

# Production install gems skipping ri and rdoc
echo "gem: --no-ri --no-rdoc" >> /root/.gemrc

# Restart shell
exec $SHELL
# Install development tools:
sudo apt-get update
sudo apt-get -y install build-essential git-core \
  make libc6-dev libssl-dev libssl-dev \
  libreadline6-dev zlib1g-dev libyaml-dev

# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

# Add rbenv to the path:
echo 'if [ -d "$HOME/.rbenv" ] ; then' >> .bash_profile
echo '  export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo '  eval "$(rbenv init -)"' >> .bash_profile
echo 'fi' >> .bash_profile
source ~/.bash_profile

# Install ruby-build:
mkdir ~/.rbenv/plugins
pushd ~/.rbenv/plugins
  git clone git://github.com/sstephenson/ruby-build.git
popd

# Install Ruby 1.9.3-p448:
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448

# Rehash:
rbenv rehash

以上是关于sh rbenv在Ubuntu 14.04 LTS上安装ruby 2.3.0的主要内容,如果未能解决你的问题,请参考以下文章

sh 另一个docker安装在ubuntu 14.04 LTS上

sh 在Ubuntu Linux 14.04 LTS上安装ThingWorx Platform 7.4的安装脚本

sh 安装Docker和Docker Compose到Ubuntu 14.04 LTS。

sh Ubuntu 14.04 LTS的配置脚本 - Apache,PHP,MySql,Git,Composer,NodeJS

sh 使用mongodump,tar和awscli自动将MongoDB数据库备份到S3(Ubuntu 14.04 LTS)

sh 使用mongodump,tar和awscli自动将MongoDB数据库备份到S3(Ubuntu 14.04 LTS)