views:

509

answers:

3

This question is really hard for me to describe, so any improvements on it would be nice.

I am currently on Ubuntu 10.4, I have installed RVM (probably as root, that could be my mistake)

I did what this guide told me to do: http://rubyonrails.dreamwidth.org/1713.html and from my point of view it worked.

I was able to create a project on Rails 3 painlessly, yay

But when starting the server or console i got: Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources.

I tryed: sudo gem install sqlite3-ruby All failed with the output:

/usr/bin/ruby1.8 extconf.rb
extconf.rb:3:in `require': no such file to load -- mkmf (LoadError)

Even after lots of dev packages installed over Ubuntu, still failed. So i ran: sudo gem1.9 install sqlite3-ruby and succeeded!

Now, I try running my server but still get the same error! My guess is that i must set gem = gem1.9, but I have no idea how =(

UPDATE:

fps ~ $ ls /var/lib/gems
# 1.8  1.9  1.9.0
fps ~ $ ls /var/lib/gems/1.8/gems
# actionmailer-2.3.5  activeresource-2.3.5  builder-2.1.2  rake-0.8.7
# actionpack-2.3.5    activesupport-2.3.5   rack-1.0.1     rubygems-update-1.3.7
# activerecord-2.3.5  activesupport-3.0.0   rails-2.3.5
fps ~ $ ls /var/lib/gems/1.9/gems
# ls: cannot access /var/lib/gems/1.9/gems: No such file or directory
fps ~ $ ls /var/lib/gems/1.9.0/gems
# sqlite3-ruby-1.3.1

UPDATE2
Have followed @"The MYYN" and @"ennuikiller" steps, here are the results:

fps ~ $ sudo rvm gem install sqlite3-ruby
[sudo] password for fps: 

info: ruby-1.8.7-p302: ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux] 
#...
1 gem installed
#...
info: ruby-1.9.2-head: ruby 1.9.2p0 (2010-09-15 revision 29252) [i686-linux] 

Building native extensions.  This could take a while...
Successfully installed sqlite3-ruby-1.3.1

and watched railscasts/201 Bundler

fps ~/Aptana Studio 3 Workspace/dum $ bundle install
Fetching source index for http://rubygems.org/
#...
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_extensio
ns': 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

Got the same error again.. If there is a way to make rails 3 work sudo remove this rvm, and bring my ruby back to 1.8.7, i am considering.

A: 

do a gem env and look at your GEM PATHS to see where rails/ruby expects to find them.

Also if you are using rvm then you need to install your gems through rvm:

rvm gem install <gem>

to insure you are updating the appropriate gem path

ennuikiller
I did, but that does not make my Rails3 app work, it does not find the sqlite, see update, please
Fabiano PS
+1  A: 

I guess my problem was too specific, the solution I found is documented on my Blog: http://fabianosoriani.wordpress.com/2010/09/21/installing-rails-3-0-0-on-ubuntu-10-4

Fabiano PS
+1  A: 

mkmf.rb is part of the ruby1.8-dev package , so try installing it.

sudo apt-get install ruby1.8-dev