Cannot start sqlite3

Hello everybody, i'm a long time watcher of these forums first time
poster.

I wanted to start getting into rails and have a play, I found a very
useful guide on the Internet detailing the install process for Ubuntu
10.04, after the install and setup process which seem to complete OK, i
went ahead and started my first project, however when I go to start the
server I get this message?

root@server:/home/code/blog# rails script/server
Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem
sources.
Try running `bundle install`.
Which I thought was very strange, I have tried running
root@server:/home/code/blog# bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.0)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.4)
Using tzinfo (0.3.23)
Using actionpack (3.0.0)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.5)
Using actionmailer (3.0.0)
Using arel (1.0.1)
Using activerecord (3.0.0)
Using activeresource (3.0.0)
Using bundler (1.0.0)
Using thor (0.14.0)
Using railties (3.0.0)
Using rails (3.0.0)
Installing sqlite3-ruby (1.3.1) with native extensions
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in
`build_extensions': ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)
/usr/bin/ruby1.8 extconf.rb
extconf.rb:3:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:3

Gem files will remain installed in
/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to
/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out
        from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in
`each'
        from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in
`build_extensions'
        from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:198:in
`install'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in
`install'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in
`run'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in
`each'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in
`each'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in
`run'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in
`install'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in
`install'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in
`send'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in
`run'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in
`invoke_task'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in
`dispatch'
        from
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in
`start'
        from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
        from /usr/bin/bundle:19:in `load'
        from /usr/bin/bundle:19

Does this message make any sense to anyone? Hope someone can help,
thanks for looking!

some gem have some kind of adaptation to C and are compiled on installation, on ubuntu you need to install build-essential libopenssl-ruby and libsqlite3-dev , note that this are not gems they are native extentions thats why bundler cant fix it, at the end the gem interact with this libraries to the code is executed in the compiled binary (ruby is interpreted).

so do

sudo apt-get install build-essential libopenssl-ruby libsqlite3-dev

Hello brito thanks for taking a look at this.

I've tried the following:
'sudo apt-get install build-essential libopenssl-ruby libsqlite3-dev'

However I receive the follow back from apt:

root@server:/home/dave# sudo apt-get install build-essential
libopenssl-ruby libsqlite3-dev
sudo: unable to resolve host server
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
libopenssl-ruby is already the newest version.
libsqlite3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Do I have these packages configured already?

did you compiled ruby from source? the best solution in case you are having problems is to install ruby version manager, it will just make everything pretty , the down side is that you have to reinstall the gems but with bundler that is way too easy.

But anyway how did you install ruby?

forgot to say that you should have ruby1.8-dev so try

sudo apt-get install ruby1.8-dev

radhames brito wrote:

forgot to say that you should have ruby1.8-dev so try

sudo apt-get install ruby1.8-dev

That worked perfectly radhames, what a great result, installed the
ruby1.8-dev and run a bundle install which added the sqlite3 gem
automatically.

many thanks!