Ruby Forum JRuby > Problem using sqlite 3

Posted by Andrea Reginato (reis)
on 14.08.2008 16:51
(Received via mailing list)
I'm trying to build a Rails app that uses JRuby and as database back end
sqlite. Now, trying to use this db engine, I'm encountering some 
trouble,
and as I know it is still work in progress I wanted to know if I'm 
making
something wrong, or if there is a solution.

I'm using jruby1.1.2 and I think I've installed all the needed gems.

  *** LOCAL GEMS ***

  activerecord (2.1.0)
  activerecord-jdbc-adapter (0.8.2)
  activerecord-jdbcmysql-adapter (0.8.2)
  activerecord-jdbcsqlite3-adapter (0.8.2)
  jdbc-sqlite3 (3.5.8)
  mongrel (1.1.5)
  rails (2.1.0)
  rake (0.8.1)
  ...

Now I created my application and I modified the database.yml 
configuration
file following the wiki instruction

  adapter: jdbcsqlite3
  url: jdbc:sqlite:development.db

At thi point I try to create the database, but i run into this error.

  $ jruby -S rake db:create:all
    (in /home/reggie/SenseControl/storage)
    rake aborted!
    no such file to load -- sqlite3

So I tried to install the ruby gem for sqlite, but I got an error again
(here an excerpt)

  $ jruby -S gem install sqlite3-ruby
    .. JRuby does not support native extensions. Check wiki.jruby.org 
for
alternatives. (NotImplementedError) ..

I tried to find something on the web, but nothing to do. So I wanted to 
know
if there is a step by step tutorial or something I can do to solve this
problem. I think I'm missing something on the installation phase.

Thanks for your time.
Posted by Hirotsugu Asari (Guest)
on 14.08.2008 17:22
(Received via mailing list)
Did you specify the adapter for all the databases defined in
database.yml?

If this is the case, I have used 'database: db/
development.sqlite3' (and the like), rather than 'url:' in the past
and been successful.
Posted by Andrea Reginato (reis)
on 14.08.2008 21:57
(Received via mailing list)
On Thu, Aug 14, 2008 at 5:21 PM, Hirotsugu Asari 
<asari.ruby@gmail.com>wrote:

> Did you specify the adapter for all the databases defined in database.yml?
>
> If this is the case, I have used 'database: db/development.sqlite3' (and
> the like), rather than 'url:' in the past and been successful.
>

Making the changes you was telling me it worked well, so thanks a lot!