tags:

views:

34

answers:

2

I have a question regarding merb dependency with sqlite. I am going to install merb on my m/c and I don't have sqlite installed on my m/c . I tried this command "gem install merb" and saw following error. If there any way to install merb with mysql please tell me.

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 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.10.2 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/do_sqlite3-0.10.2/ext/do_sqlite3/gem_make.out

A: 

haven't ever used merb, but it is probably using sqlite as a default for databases, which is why its a framework dependency. if you are on ubuntu, try

sudo apt-get install sqlite3 libsqlite3-dev libsqlite3-ruby
sudo gem install sqlite3-ruby

if you are on another distro or another os, google for how to install the dev version of sqlite, then install the gem (second line)

rails has the same dependency, if you google for the error and your os, you will probably get about a billion results telling you what to get.

Matt Briggs
Thanks Matt for your reply.
mayank
A: 

You will need to choose an ORM for your project, which merb does not have built-in. The most popular choice is DataMapper, which has abstractions that will let you use mysql without problems. Check the DataMapper docs for setup.

You can even use a database.yml file identical to rails if you'd like; DM accepts the same values.

x1a4