简体   繁体   中英

What are the dependencies given on “rvm requirements” useful for?

Why does RVM, Ruby or Rails need libc6-dev, ncurses-dev and libtool ?

on Ubuntu running rvm requirements gives us:

Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10" )

NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the original / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius

bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).

To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head), then you
must install and use rvm 1.8.7 first.

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

# For JRuby, install the following:
jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

# For IronRuby, install the following:
ironruby: /usr/bin/apt-get install curl mono-2.0-devel

Why does RVM, Ruby or Rails need libc6-dev, ncurses-dev and libtool ?

For the other packages, as far as i can make out:

build-essential automake bison autoconf pkg-config is useful for compiling from source
libreadline6 libreadline6-dev is needed for irb's readline support
openssl libssl-dev is required for ruby's SSL support
curl git-core subversion is required for fetching software
zlib1g zlib1g-dev is required for unpacking rubygems
libyaml-dev is required for ruby's YAML support
libsqlite3-dev sqlite3 is required for sqlite support for rails
libxml2-dev libxslt-dev is required for parsing XML via nokogiri

Want to know why RVM added them in the first place?
What well known libraries will break if any of these packages are not installed?
Which of these packages are necessary for ruby itself to be installed and which of them are needed for a stdlib ie. yaml or rexml ?

EDIT: forgot pkg-config
EDIT: added some more questions at the end

libc6-dev are the C standard library development files. It's very unlikely that any useful C code would compile without them. As Ruby is written in C, those are needed to compile and build ruby itself.

I would guess that ncurses is needed to compile irb.

I would agree with the purpose of the other packages you mention.

These are all basic libraries which are dependencies for various gems you will use in future.

 build-essential openssl libreadline6
 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev 
 libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev 
 autoconf libc6-dev ncurses-dev automake libtool bison subversion

There may be a case like you will not require all the libraries in you m/c, though when you will install some gems, errors like

cannot build native extension

In those cases the required libraries are looked upon for the failed gem and installed. Libraries are installed only once and are totally different as compared to gems. The libraries present here are for

Git, mysql server, sqlite, curl etc.

I would suggest to install it in the beginning with sudo permissions using Sudo apt-get install. Hope this helps. Also as you try out new gems and plugins, you would be installing new libraries in future.

ruby带有一组扩展,其中一些扩展需要其他软件包,例如,需要ncurses以获得更好的控制台支持(irb)-但不是必需的,软件包搜索需要pkg-config-大多数软件包都公开了一个配置文件,这有助于在寻找正确的编译路径...等等,这是所有扩展的列表: https : //github.com/ruby/ruby/tree/trunk/ext ...尽管这不是要求的列表-我可以找不到官方的红宝石要求清单。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM