Linux Install Ruby

Source: Internet
Author: User
Tags git clone



It can be installed using sudo apt-get install ruby, but the version installed in this way is generally older. Alternatively, you can install the new version in the following ways.






1. First update the software source, using the domestic. Reference: Http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8



2. Refresh the list:



sudo apt-get update


3. Install the necessary:

 
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-de


4. Install Ruby using rbenv


 
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo ‘export PATH="$HOME/.rbenv/bin:$PATH"‘ >> ~/.bashrc
echo ‘eval "$(rbenv init -)"‘ >> ~/.bashrc
exec $SHELL

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo ‘export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"‘ >> ~/.bashrc
exec $SHELL

rbenv install 2.2.0
rbenv global 2.2.0
ruby -v


5. Or use RVM to install (4 and 52 select one)



\curl-l https://Get.rvm.io | bash-s stablesource ~/install ruby-2.2
    .0

rvm listrvm use --default ruby-2.2.0

$HOME/.rvm/rubies export PATH=$PATH:$HOME/.rvm/rubies/ruby-2.2.0/bin


6. Use Taobao's rubygems image



Gem sources--remove https://rubygems.org/gem sources-a https://ruby.taobao.org/ 


7. If you use bundles, modify the Gemfile



' https://ruby.taobao.org/ '


Linux Install Ruby


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.