如何在没有RVM的情况下在Ubuntu上安装Ruby 1.9.3? [英] How do I install Ruby 1.9.3 on Ubuntu without RVM?

查看:98
本文介绍了如何在没有RVM的情况下在Ubuntu上安装Ruby 1.9.3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在没有rvm的Ubuntu上安装ruby 1.9.3



我运行

  sudo apt-get install ruby​​ 

它采用了ruby 1.8和ruby 1.9.1 。

如果我这样做
$ b $ pre $ sudo apt-get install ruby 1.9.3 -p XXXX

我仍然无法安装ruby。如何在Ubuntu上安装ruby?

解决方案

第一种方法

来源

http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/



新的Ubuntu发行版刚刚推出,并附带一些新的软件包。就我个人而言,我正在密切关注Ruby的开发,但Ubuntu上的默认Ruby仍然是我不推荐的1.8系列。 Ruby 1.9的性能得到了一些改进,特别是1.9.3,与1.9.2相比有很大的提升。

然而,正如我在之前的文章中所阐述的那样,Ruby不使用RVM而是使用RVM而不是1.8的Ubuntu系列并不是那么容易。如果您对这些细节感兴趣,请阅读帖子。



简短版本是:您可以通过安装ruby-1.9.1包来获得Ruby 1.9.3-p0 。 (该软件包被称为1.9.1,因为这是ABI版本。)



如果您想让Ruby 1.9成为默认设备,请执行以下操作:

  sudo apt-get update 
$ b sudo apt-get install ruby​​1.9.1 ruby​​1.9.1-dev \

ruby​​gems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \ build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
$ b $ sudo update-alternatives --install / usr / bin / ruby​​ ruby​​ /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby​​.1.gz \
/ usr / share / man / man1 / ruby​​1.9.1.1.gz \
--slave / usr / bin / ri ri /usr/bin/ri1.9.1 \
--slave / usr / bin / irb irb /usr/bin/irb1.9.1 \
--slave / usr / bin / rdoc rdoc /usr/bin/rdoc1.9.1

#选择您的解释器
#更改/ usr / bin / ruby​​,/ usr / bin / gem的符号链接
#/ usr / bin / irb,/ usr / bin / ri和man(1)ruby


sudo update-alternatives --config ruby​​
sudo update-alternativ es --config gem

#现在尝试
ruby​​ --version





编辑:我今天发现还有一个软件包称为ruby1.9.3然而,这只是一个代理包,没有任何文件本身,只依赖于ruby1.9.1。 Aptitude证实了这一点:Ruby使用两种并行的版本管理方案:Ruby库兼容版本(这个包为1.9.1),它类似于一个库SONAME,和Ruby版本(这个包为1.9.3)。 Debian中的Ruby包使用Ruby库兼容版本进行命名,对于那些没有密切关注Ruby开发的用户来说,这有时令人困惑。这个包依赖于ruby1.9.1包,并提供从1.9.3可执行文件和手册页到1.9.1对应文件的兼容符号链接。



成为一个rubygems1.9.3。

第二种方法

另外这个链接我发现有用它的非常简单和有效。



http:/ /ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/


I want to install ruby 1.9.3 on Ubuntu without rvm

I run

sudo apt-get install ruby

It's taking ruby 1.8 and ruby 1.9.1.

And if I do

sudo apt-get install ruby 1.9.3 -p XXXX

I am still not able to install ruby. How can I install ruby on Ubuntu?

解决方案

1st approach

Source
http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/

The new Ubuntu release has just rolled around and with it a slew of new packages. Personally, I'm tracking the development of Ruby quite closely but the default Ruby on Ubuntu ist still the 1.8 series which I can't recommend. Ruby 1.9 has some performance improvements and 1.9.3 in particular a lot of them compared to 1.9.2.

However, as I have elaborated in a previous post getting the Ruby 1.9 series on Ubuntu without using RVM instead of 1.8 isn't all that easy. Please read the post if you are interested in the details.

The short version is: You can get Ruby 1.9.3-p0 by installing the ruby-1.9.1 package. (The package is called 1.9.1 because that is the ABI version.)

If you want to make Ruby 1.9 the default do the following:

sudo apt-get update

sudo apt-get install ruby1.9.1 ruby1.9.1-dev \

 rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \ build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev

sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
     --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
                /usr/share/man/man1/ruby1.9.1.1.gz \
     --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 \
    --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 \
    --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1

# choose your interpreter
# changes symlinks for /usr/bin/ruby , /usr/bin/gem
# /usr/bin/irb, /usr/bin/ri and man (1) ruby


 sudo update-alternatives --config ruby
 sudo update-alternatives --config gem

# now try
 ruby --version

If you want to make this your exclusive Ruby and get rid of Ruby 1.8 follow the uninstallation instructions.

Edit: I found out today that there also is a package called ruby1.9.3 however that is just a proxy package that doesn't have any files itself and only depends on ruby1.9.1. Aptitude confirms this:

Ruby uses two parallel versioning schemes: the `Ruby library compatibility version' (1.9.1 for this package), which is similar to a library SONAME, and the 'Ruby version' (1.9.3 for this package). Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely. This package depends on the ruby1.9.1 package, and provides compatibility symbolic links from 1.9.3 executables and manual pages to their 1.9.1 counterparts.

There doesn't seem to be a rubygems1.9.3.

2nd approach

Also This link i found useful its very simple and effective.

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

这篇关于如何在没有RVM的情况下在Ubuntu上安装Ruby 1.9.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆