Error installing merb 0.9.10 in debian etch

0 views
Skip to first unread message

maxbaroi

unread,
Oct 25, 2008, 3:22:02 PM10/25/08
to merb
I'm trying to install merb on a fresh isntall of debian etch.
I installed merb from rubygems by first installing rubygems via the
instructions at
http://wiki.merbivore.com/howto/installation/gems

Then when I did installl merb suing gem install merb, I got the
following message:

Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing merb:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install merb
checking for sqlite3.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
do_sqlite3-0.9.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/ext/
gem_make.out
Updating class cache with 1845 classes...

I didn't know what to do so I tried creating a test app following the
isntructions at
http://wiki.merbivore.com/howto/gettingstarted/firstapp

merb-gen app my-app worked perfectly, but then when I tried
merb-gen resource article title:string I got the following message

Loading init file from /home/max/my-app/config/init.rb
Loading /home/max/my-app/config/environments/development.rb
~
~ FATAL: The gem dm-aggregates (= 0.9.6, runtime), [] was not found
~
~
~ FATAL: The file dm-aggregates was not found
~

I decided to come here before doing gem install dm-aggregates, because
the last time I tried to install merb I got into this dependency hell
where I ran merb, installed a new gem as dictated to me by an error
message, and then repeated that process half a dozen times more times,
until I was asked to install something I couldn't.

This is something like my third or fourth attempt to install merb. I'm
starting to think I should wait until 1.0.

Any help would be appreciated.

Michael Klishin

unread,
Oct 25, 2008, 3:32:35 PM10/25/08
to me...@googlegroups.com
2008/10/25 maxbaroi <max....@gmail.com>:

> ERROR: Error installing merb:
> ERROR: Failed to build gem native extension.
>
> /usr/bin/ruby1.8 extconf.rb install merb
> checking for sqlite3.h... no
> *** extconf.rb failed ***
> Could not create Makefile due to some reason, probably lack of
> necessary libraries and/or headers. Check the mkmf.log file for more
> details. You may need configuration options.

sudo apt-get install libsqlite3-dev
--
MK

maxbaroi

unread,
Oct 25, 2008, 5:49:58 PM10/25/08
to merb
Thank you Michael, I was able to generate the resource just fine, but
now when I try to run the command merb, it's giving me a similar
message, but this time it says that I don't have openssl.
So I installed libssl-dev, but I'm still getting the same message.

Michael Klishin

unread,
Oct 25, 2008, 6:02:49 PM10/25/08
to me...@googlegroups.com
2008/10/26 maxbaroi <max....@gmail.com>:

You need to compile ruby with openssl enabled. I do not know what is
the simplest way to do it with Debian packages
since I always compile Ruby from source with a fairly simple script.

Check it out if you want:
http://gist.github.com/19803

For memcached gem (with C extension) you would need libmemcached or
something. For MySQL drivers for ActiveRecord it's
libmysqlclient15-dev or something.
--
MK

maxbaroi

unread,
Oct 25, 2008, 6:40:29 PM10/25/08
to merb
On Oct 25, 3:02 pm, "Michael Klishin" <michael.s.klis...@gmail.com>
wrote:
> 2008/10/26 maxbaroi <max.ba...@gmail.com>:
I decided to do a fresh install again, and follow your method, but
when I do sh gistfile1.sh I get the following error:

: command not found2:
E: Invalid operation update
Reading package lists... Done
Building dependency tree... Done
zlib1g-dev is already the newest version.
libreadline5 is already the newest version.
libncurses5 is already the newest version.
E: Couldn't find package libmagick++9-dev
: command not found5:
gistfile1.sh: line 35: syntax error: unexpected end of file

Michael Klishin

unread,
Oct 25, 2008, 6:54:59 PM10/25/08
to me...@googlegroups.com
2008/10/26 maxbaroi <max....@gmail.com>:

> I decided to do a fresh install again, and follow your method, but
> when I do sh gistfile1.sh I get the following error:
>
> : command not found2:
> E: Invalid operation update
> Reading package lists... Done
> Building dependency tree... Done
> zlib1g-dev is already the newest version.
> libreadline5 is already the newest version.
> libncurses5 is already the newest version.
> E: Couldn't find package libmagick++9-dev
> : command not found5:
if you don't need imagemagick remove it and libmagick from the list of
installed packages

> gistfile1.sh: line 35: syntax error: unexpected end of file

This error is probably because I pasted that script with slight modifications
(original installs zsh, emacs and other things I use but others not
necessary do the same)

--
MK

maxbaroi

unread,
Oct 25, 2008, 7:20:32 PM10/25/08
to merb
Michael,

I did a fresh install, and installed ruby from source by going through
your shell script and just entering the commands myself (My shell
scripting skills are non-existent, so I didn't recognize that was for
zsh and not bash).
I then did sudo gem install merb, and everything was perfect.
Installed hoe. I was able to generate my app just fine, but now when I
tried to generate a resource entering:
merb-gen resource article title:string content:text
and I get the following error
~
~ FATAL: The gem dm-aggregates (= 0.9.6, runtime), [] was not found
~
~
~ FATAL: The file dm-aggregates was not found
~
Is there a light at the end of the tunnel, or am I going to enter
dependency hell again?

maxbaroi

unread,
Oct 25, 2008, 8:04:35 PM10/25/08
to merb
I was able to get it past the point where I could generate resources,
I installed the following gems:
dm-aggregates
dm-timestamps
dm-types
dm-validations
dm-core (The rest I was prompted to installed, this one I installed
because I remember the name and thought it would get me out of this
jam)

After all this, I was finally able to generate resources.
So then I tried merb as per the instructions for "Generate your first
app" on the wiki, and was greeted with this error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:578:in
`report_activate_error': Could not find RubyGem do_sqlite3 (>= 0.9.5)
(Gem::LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:134:in
`activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'

So then I tried to install that gem using gem install do_sqlite3 and
got this error message
_____________________________________________
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install do_sqlite3
checking for sqlite3.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib


Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
do_sqlite3-0.9.6 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/do_sqlite3-0.9.6/
ext/gem_make.out
_________________________

This is driving me crazy.

Jonathan Stott

unread,
Oct 25, 2008, 8:12:12 PM10/25/08
to me...@googlegroups.com

For future reference, if you want openssl in ruby on debian, you can do

aptitude (or apt-get) install libopenssl-ruby

To get the bindings.

> >

maxbaroi

unread,
Oct 25, 2008, 9:19:17 PM10/25/08
to merb
I aid screw it to sqlite, and now I tried to do this mysql.
I installed do_mysql, changed database.yml, created the table and was
successfully able to do db:automigrate.
Now I try
$: merb
once again, and get
_____________________________
Loading init file from /home/max/my-first-app/config/init.rb
Loading /home/max/my-first-app/config/environments/development.rb
~ Connecting to database...
~ Loaded slice 'MerbAuthSlicePassword' ...
~ Parent pid: 21240
~ Compiling routes...
~ Activating slice 'MerbAuthSlicePassword' ...
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- mongrel (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `require'
[etc.]
____________________________

What's wrong now?

Julian Leviston

unread,
Oct 25, 2008, 9:24:56 PM10/25/08
to me...@googlegroups.com
You don't have mongrel installed.

It says it in the backtrace... "no such file to load -- mongrel"

Julian.

maxbaroi

unread,
Oct 25, 2008, 9:40:12 PM10/25/08
to merb
I installed mongrel and everything worked out fine. I can see the merb
page on port 4000. I guess gem 1.2.0 didn't install mongrel when I
installed merb

Julian Leviston

unread,
Oct 25, 2008, 9:44:57 PM10/25/08
to me...@googlegroups.com
You're welcome. :P

Julian

maxbaroi

unread,
Oct 25, 2008, 9:57:37 PM10/25/08
to merb
I'm sorry I didn't thank you. I thought I did.

Michael Klishin

unread,
Oct 26, 2008, 1:31:36 AM10/26/08
to me...@googlegroups.com
2008/10/26 maxbaroi <max....@gmail.com>:

>
> I installed mongrel and everything worked out fine. I can see the merb
> page on port 4000. I guess gem 1.2.0 didn't install mongrel when I
> installed merb

Since most of exception you got here are from rubygems, I think we should
catch them in dependency loading code and output something more friendly.

Every time someone has the same problem, I personally bitch at "damn
helpless software engineers of the 21 century, who call themselves
'Ruby rockstars'
but hardly can even read an exception trace and never read the source
code of essential Ruby software like RubyGems".
But I cannot be sure that you have any technical background at all so... :)

If you have any ideas on what error messages you'd like to see (say
"Hey, Merb cannot load gem so and so, do the following to install it.
For the list of common gotchas with some common gems see wiki page at
..."),
just leave a reply in this thread.

Again, I'd like to stress that Merb pushes RubyGems to it's limit even
when it comes to error messages.
But it only should help us make RubyGems better for everyone in the
future. So it's not a Dependency Hell (does it sound like a movie
title to you too?)
but a Growth Period instead.
--
MK

maxbaroi

unread,
Oct 26, 2008, 3:21:04 AM10/26/08
to merb
First off, thanks again to everyone that replied. I would have dead in
the water without each of you.
I'm definitely no software engineer much less self-proclaimed rock
star. I'm a kid with a SICP course and a few months of Rails under my
belt. But looking back at the intsallation process, there were a few
messages I wish I had received.

When I generated a resource I first got an error message that said I
didn't have the dm-aggregates package, then when I installed that and
tried the same command I got an error message saying I didn't have the
dm-timestamps package, and then one saying I didn't have dm-types,
then dm-validations.
Generating a resource seems like it'd be a very common command, and
one that every beginner to merb would use.
What about a message that said
"Error when trying to create resource, missing db-aggregates,
Possible reason: To generate a resource with a fresh install of
merb, you must have the following resources
dm-aggregates
dm-timestamps
dm-types
dm-validations"
It would save some time, and aggravation for new users, though I know
the merb is targeted towards more knowledgeable and proficient users
than rails is.

I was a bit confused about this message:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- mongrel (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `require'

I thought I had mongrel (I thought it was installed with merb) and was
missing 'gem_original_require', so I didn't think of installing
mongrel until I was instructed. But all my trouble was due way more to
my ignorance than to ruygem's message.
I got this message when typing in merb to start the server, so when
merb runs across an error like this, can it check with rubygems to see
if mongrel or thin is installed and hand back an error message like:
"No known server has been installed via rubygems"
Once again, like the above proposed message this message is totally
targeted to new users making dumb mistakes, and therefore might not be
worth it to add since anyone would need this message only on their
first day of merb.

I think a very useful error message would be if it displayed a tree of
what I need. I'd like to see the gems that will be installed before
the installation happens.
Like
:Error missing the following gems:
--gem-A (ver 1.0) which requires
----gem-I (ver 1.0)which requires
------gem-a (ver 1.0)
------gem-b (ver 1.0)
----gem-II (ver 1.0)
No I know I'm digressing a bit, but I would
Then when I type in gem install gem-A, I'd like to see the same tree
and have rubygems ask me if this installation tree is acceptable, and
then offers me the chance to download a different version of a
dependency, like install instead gem-I version 0.9 instead, and then
it will repeat the process offer me an updated dependency tree like
--gem-A (ver 1.0) which requires
----gem-I (ver 0.9) which requires
------gem-a (ver 1.0)
------gem-b (ver 0.8)
----gem-II (ver 1.0)
Asks me if this is acceptable, and I can say yes no, or make another
change.
For all I know, gem does offer that. But right now when I install a
gem I don't know what other gems (and what versions of these gems) are
going to be installed until after I give the okay to install.

In all likelihood these ideas aren't implemented because they're
terrible. Like I said in the beginning, I'm an ignorant nobody. But if
I do get an idea of something to add to an error message, I'll be sure
to post it here.

Julian Leviston

unread,
Oct 26, 2008, 7:45:48 AM10/26/08
to me...@googlegroups.com
Hey Michael,

Two things.

1. I tend to agree with you about software engineers. They haven't cut
their teeth by trying to do things the hard way in much more difficult
languages - they don't fully appreciate the amount of time Ruby saves
you when writing software, because frameworks like Merb and Rails, and
for that matter even WebObjects and Java frameworks and others do so
much for you. They make it so much easier. There's so much you DON'T
have to think about. However, this is no excuse to be entirely
ignorant of these issues.

Frameworks exist mostly for experienced programmers, not new ones...
they exist because truly good programmers are defined by what they
DON'T write more than what they DO write. They spend less time writing
code because they re-use code that they already have. The sum of the
code for the web applications I've written act as a library of code
that I personally can draw on to build new web applications. I have
existing elegant solutions to common problems, so I re-use them.
Frameworks are a reflection of this, and therefore should be used by
programmers only when they have an awesome grasp of what the framework
does - or at least a rudimentary one!

2. Having said all that, people have to start somewhere. I've long
wondered why things can't be simultaneously easy, simple and
instructive, AND powerful, customizable and concise. There is
definitely a huge hole when it comes to the education of programmers,
and not least this is because the more experienced a programmer
becomes, the less "in touch" with the beginner's mind they are. It's
the same in any field. It takes a very very very special sort of
person to be able to simultaneously be young in the mind and draw on
one's experience to abstract understanding and apply it, with energy.
And another layer of special on top of that to be able to share the
experience and understanding with another (mostly because one must
understand oneself first).

There is a definite tendency towards knee-jerk reactions of pointing
blame. An open source framework is not a product you buy off the shelf
and then act like a user and expect customer support. Joining this
(and especially the larger Ruby) community, an attitude of gratitude
at being given help ought to be fostered. It was not always this easy,
and it was not always this powerful. We must not lose sight of
history. Using Merb, one is part of a web application history that
goes back many years, and sits on generations of technology. New
people need at least a sense of this, and older people need to be
mindful of this to bring respect into the equation.

Sometimes I am sitting, coding, and I'm entirely filled with what a
wonderful thing it is to be able to sit and type this wonderful code,
in this wonderful language, and have my meanings be expressed as they
are. Of course, usually after about 5 minutes of this, I get
distracted by the problem again, but at least these days the moments
of joy are far more frequent :-)

I do think that we've only just scratched the surface, though. This
language is wonderful, but there are far more expressive ways we could
convey our meanings for modelling our imagined logic.

Julian.

Julian Leviston

unread,
Oct 28, 2008, 1:01:40 AM10/28/08
to me...@googlegroups.com
HI Max,

It's precisely because you're a nobody that makes you the ideal
candidate for giving advice on how to shape the framework. You're
actually a developer's best friend - whether they treat you as such or
not, because you're FRESH.

They're really good suggestions you have. I hope they're taken on
board. It'd make the framework much nicer, and actually much nicer
than Rails is at the moment, too.

I have to say that Merb *is* a framework (ie a set of code, but not a
product), and while Rails attempts to grab people who have no
experience in anything - let alone Ruby or web app development - Merb
is definitely targeted at the slightly-more-mature and a slightly-more-
discerning Ruby developer.

Thanks for not giving up hope, though :) You'll find that persistence,
and continually stripping back your assumptions are the best assets
you could ever have (for instance, you thought you had Mongrel
installed... I've spent countless hours on similar circular-tracing of
an issue before I realise that one or more of my assumptions was
fallacious: this is something that not just noobs do). These days I
know enough to fairly quickly re-check my assumptions down to the
lowest level I can.

Julian.

maxbaroi

unread,
Oct 28, 2008, 8:24:17 PM10/28/08
to merb
Hey Julain,

Thanks for the kind words.

I saw another error message I'd like to see improved. I was fooling
around with some view code, and in the process broke it. When I posted
the form I the view created it called the create action. The form
didn't create a hash with the name of the argument for the create
action so I got a Bad Request error. I think it'd be more helpful if
there was a message along the line of "create action expecting an
argument called appointment, params hash does not include a key named
appointment" .

I think having a topic about improving error messages is a great idea,
and I'm happy to be a part of it.

-Max
Reply all
Reply to author
Forward
0 new messages