我想在我的debian lenny服务器上安装最新的ruby和rails。
我找到了http://packages.debian.org/lenny-backports/ruby1.9.1-full包,但是当我尝试用来安装它时,我得到的结果是:
atlas:~# apt-get install ruby1.9.1-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ruby1.9.1-full我的sources.list看起来像这样:
atlas:~# cat /etc/apt/sources.list
deb http://ftp.se.debian.org/debian/ lenny main non-free contrib
deb-src http://ftp.se.debian.org/debian/ lenny main non-free contrib
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free我必须做什么才能安装它?
发布于 2011-01-14 19:17:31
停。往回走。安装Ruby Debian的任何版本,可能是1.8.7或1.8.7。然后安装RVM。我有一些关于using RVM with Ubuntu的方向(对不起,不是Debian,但是很接近)。说真的,RVM使得安装任何版本的Ruby都很容易。然后,使用RVM安装Ruby 1.9.2,你不会想要1.9.1。
这将取决于您想要使用Ruby做什么。出于开发目的,使用RVM工作得非常好。出于服务器目的,我认为可以使用它,但您可能会遇到一些问题。我认为RVM为您提供了一些脚本,您可以使用它们来运行带有init脚本和cron作业的Ruby脚本。
或者,您可以直接从源代码安装。这并不难,也不是debian的方式,但它可以完成工作。这可能比安装一些第三方软件包更可取,在这些软件包中,您可能不知道它们在编译时做了什么,以及如何在出现安全漏洞的情况下快速更新。使用RVM或从源代码手动安装,您可以在需要时进行更新。
发布于 2011-01-14 19:31:25
首先运行以下命令:
apt-get update然后安装Ruby
apt-get install ruby然后你需要rubygems。
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz解开红宝石。
tar xvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem现在更新rubygems
gem update --system现在我们可以安装rails了
gem install rails您可以使用以下命令检查安装是否成功:
ruby -v
rails -v
gem -v如果你需要更多的帮助,请告诉我!
如果您想要Ruby 1.9.2,请替换以下命令:
apt-get install ruby使用
apt-get install ruby1.9如果需要dev头文件,只需安装ruby1.9-dev即可。
apt-get install ruby1.9-dev如果你不能以这种方式安装它们,你需要查看apt-get源代码。
apt-cache search ruby1.9
libhtree-ruby1.9 - HTML/XML tree library for Ruby 1.9
....
libinotify-ruby1.9 - Ruby interface to Linux's inotify system
....
libdbm-ruby1.9 - DBM interface for Ruby 1.9
libgdbm-ruby1.9 - GDBM interface for Ruby 1.9
....
**ruby1.9-dev** - Header files for compiling extension modules for the Ruby 1.9
ruby1.9-elisp - ruby-mode for Emacsen
ruby1.9-examples - Examples for Ruby 1.9
**ruby1.9** - Interpreter of object-oriented scripting language Ruby 1.9
libstfl-ruby1.9 - Ruby bindings for the structured terminal forms language/library我希望这个helps.And我会建议使用RVM (但我没有在这里讨论这一点。)
发布于 2011-09-03 04:18:40
RVM是一个很好的解决方案,但不适用于生产环境。它的$PATH魔力太过挑剔,而且经常崩溃。
我建议您为自己构建一个.deb。从源代码编译Ruby,然后使用checkinstall安装它。然后,您可以将它创建的.deb分发到任何计算机,并使用dpkg安装/卸载它,就像您对任何包所做的那样。
在Ubuntu中做这件事的Here's a tutorial;它应该很容易翻译成Debian。
https://stackoverflow.com/questions/4690399
复制相似问题