Ruby1.9.1 on Ubuntu 10.04 Lucid Lynx with RubyGems, Ramaze, Sequel, Sqlite, Nokogiri and Sanitize

44 views
Skip to first unread message

John

unread,
Jul 8, 2010, 2:04:22 PM7/8/10
to Ruby Hellug
There are actually two sane ways to install Ruby 1.9.1 on Ubuntu 10.04

a) Use only 'aptitude' (or apt-get for that matter)
b) Build from sources

If you try to combine them prepare to sacrifice a goat or two. It
happened to me so I'm giving you here a quick way to re-start and use
aptitude only.

If you just do it with 'aptitude' it is pretty easy but you will be
left with RubyGems 1.3.5 as opposed to 1.3.7 and you'll have to wait
for the Ubuntu/Debian packages to be updated first, so there is no
chance of of 'gem update --system'.

...choose your poison

Installing Ruby 1.9.1 for development
-----------------------------------
sudo aptitude install ruby1.9.1-full


Installing RubyGems package system
-----------------------------------
UNORTUNATELY due to:
http://help.rubygems.org/discussions/problems/160-gems-wont-load
http://www.ruby-forum.com/topic/206110
http://pkg-ruby-extras.alioth.debian.org/rubygems.html

We can't have RubyGems 1.3.7. This may not be a problem for most
people since in 1.9.x we're used to having whatever version of
RubyGems comes in the ruby setup by default (apart from Debian/Ubuntu
of course)

Therefore, DO NOT attempt to build 1.3.7 from sources when having
installed with aptitude (or apt-get) because you'll spend a day
chasing your tail and cursing Debian's "policies" (to put it lightly).

If you do go there by accident and want to restart, then you MUST

'sudo aptitude purge rubygems1.9.1'
'sudo aptitude purge ruby1.9.1-full'

_and_ also make sure you remove all directories that may have stale
ruby files ('ls -R /usr | grep ruby' will help there)

This is because the RubyGems installation fiddles with the config and
files of ruby and even if you try to reinstall with:

'sudo aptitude remove rubygems1.9.1'

things will not work because rubygems will think it is 1.3.7 as
opposed to 1.3.5 and all hell WILL break lose.

For the time being we'll have to stick with rubygems 1.3.5 when using
'aptitude' by doing:

sudo aptitude install rubygems1.9.1

immediatelya fter you installed ruby1.9.1-full

Installing Sqlite3
------------------
sudo aptitude install sqlite3, sqlite3-doc, libsqlite3-ruby1.9.1


Installing Ramaze 2010.06.18
----------------------------
sudo gem install ramaze
(this installs Rack 1.2.1 and the core of Ramaze which is Innate)


Installing Sequel 3.13.0
------------------------
sudo gem install sequel


Installing Nokogiri 1.4.2
-------------------------
sudo aptitude install libxslt-dev
(this installs libxml 2.7.6)

sudo gem install nokogiri

Installing Sanitize 1.2.1
-------------------------
sudo gem install sanitize

Hope to have helped whoever may want ruby1.9.1 on Lucid Lynx
/pagojo

Christos Trochalakis

unread,
Jul 9, 2010, 3:30:58 AM7/9/10
to AthensR...@yahoo.com, Ruby Hellug
I don't know why we usually want to install things system-wide when we
all use a single user pc :) When developing you usually want upstream
versions of various gems and packages, just install them on your home
directory _without messing your system files_.

(sudo should die)

2010/7/8 John <AthensR...@yahoo.com>:


> There are actually two sane ways to install Ruby 1.9.1 on Ubuntu 10.04
>
> a) Use only 'aptitude' (or apt-get for that matter)
> b) Build from sources
>

There is a third option, rvm[0]. Install 1.9.1, 1.9.2.preview or if
you are adventurous enough 1.9.2-head. rvm will install rubies in your
~/.rvm maintaining different gems and configurations for each of them,
the only thing you need to do is `rvm use 1.9.1`

But if you only care about rubygems 1.3.7 (e.x if you want bundler to
work) and don't need the headache there is a quick hack:

$ sudo gem install rubygems-update
$ sudo rubygems_update
$ gem --version
1.3.7

[0] http://rvm.beginrescueend.com/

Petros Amiridis

unread,
Jul 9, 2010, 4:50:40 AM7/9/10
to Ruby Hellug

John

unread,
Jul 9, 2010, 7:48:04 AM7/9/10
to Ruby Hellug


On Jul 9, 8:30 am, Christos Trochalakis <yati...@ideopolis.gr> wrote:
> I don't know why we usually want to install things system-wide when we
> all use a single user pc :) When developing you usually want upstream
> versions of various gems and packages, just install them on your home
> directory _without messing your system files_.
>
> (sudo should die)
>

Well some of us may have different requirements and may need to
operate on a multi-user environment (server) controlled by a strict
admin and related policies.

> 2010/7/8 John <AthensRubyJ...@yahoo.com>:
>
> > There are actually two sane ways to install Ruby 1.9.1 on Ubuntu 10.04
>
> > a) Use only 'aptitude' (or apt-get for that matter)
> > b) Build from sources
>
> There is a third option, rvm[0]. Install 1.9.1, 1.9.2.preview or if
> you are adventurous enough 1.9.2-head. rvm will install rubies in your
> ~/.rvm maintaining different gems and configurations for each of them,
> the only thing you need to do is `rvm use 1.9.1`
>

Oh yes we like RVM :-)
but still somehow you need the packages on the system if you need them
on the system.

Anyway the post was about sorting out the mess if you've tried to
combine building from sources and using 'aptitude'.

> But if you only care about rubygems 1.3.7 (e.x if you want bundler to
> work) and don't need the headache there is a quick hack:
>
> $ sudo gem install rubygems-update
> $ sudo rubygems_update
> $ gem --version
> 1.3.7
>

right :-)
will this work on a Ubuntu/Debian when Ruby1.9.1 is installed with
'aptitude' ?

cheers
/pagojo

Christos Trochalakis

unread,
Jul 9, 2010, 8:43:49 AM7/9/10
to AthensR...@yahoo.com, Ruby Hellug
2010/7/9 John <AthensR...@yahoo.com>:

>
>
> On Jul 9, 8:30 am, Christos Trochalakis <yati...@ideopolis.gr> wrote:
>> I don't know why we usually want to install things system-wide when we
>> all use a single user pc :) When developing you usually want upstream
>> versions of various gems and packages, just install them on your home
>> directory _without messing your system files_.
>>
>> (sudo should die)
>>
>
> Well some of us may have different requirements and may need to
> operate on a multi-user environment (server) controlled by a strict
> admin and related policies.
>

Yes you are right, I was talking about developing setups, sorry if I
sounded aphoristic :)

>> But if you only care about rubygems 1.3.7 (e.x if you want bundler to
>> work) and don't need the headache there is a quick hack:
>>
>> $ sudo gem install rubygems-update
>> $ sudo rubygems_update
>> $ gem --version
>> 1.3.7
>>
>
> right :-)
> will this work on a Ubuntu/Debian when Ruby1.9.1 is installed with
> 'aptitude' ?
>

It should, as long as 'gem' points to the 1.9.1 version (1.9.1 is the
default ruby).

(I also think that the latest ree comes with rubygems 1.3.7 but that's
ruby 1.8.7)

Reply all
Reply to author
Forward
0 new messages