[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Mac OS X configuration woes

Dan Munk

1/27/2006 6:22:00 AM

Hello,

Sorry for the repetitive post, but I've scoured all of the Mac Ruby
pages and still haven't found a solution to my issue. Up to date
version of Tiger. I have 1.8.4 installed.

ruby -v yields:

ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

I have gem installed. gem -v gives me:

0.8.11

gem env outputs:

Rubygems Environment:
- VERSION: 0.8.11 (0.8.11)
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- GEM PATH:
- /opt/local/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rub...

gem list outputs:
actionmailer (1.1.5)
Service layer for easy email delivery and testing.

actionpack (1.11.2)
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.0.0)
Web service support for Action Pack.

activerecord (1.13.2)
Implements the ActiveRecord pattern for ORM.

activesupport (1.2.5)
Support and utility classes used by the Rails framework.

rails (1.0.0)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.7.0)
Ruby based make-like utility.

sources (0.0.1)
This package provides download sources for remote gem installation

sqlite3-ruby (1.1.0)
SQLite3/Ruby is a module to allow Ruby scripts to interface with a
SQLite3 database.

When I execute:
irb(main):001:0> require 'sqlite3'

I get the following:

LoadError: no such file to load -- sqlite3
from (irb):1:in `require'
from (irb):1

I installed swig using DarwinPorts. Any direction would be greatly
appreciated.

Thanks,
Dan

3 Answers

Alex Fenton

1/27/2006 6:03:00 PM

0

Dan Munk wrote:
> Hello,

> When I execute:
> irb(main):001:0> require 'sqlite3'
>
> I get the following:
>
> LoadError: no such file to load -- sqlite3
> from (irb):1:in `require'
> from (irb):1

Two suggestions:

1) It doesn't look like you've loaded rubygems before you tried to load the sqlite3 gem. If you want Ruby to load libraries from gems, say

require 'rubygems'

before you try and require sqlite3.

You can make ruby do this automatically by using environment variable RUBYOPT, but you'll have to enable this yourself on OS X. Check the rubygems docs.

2) Make sure you have the sqlite3 library itself installed as well as the ruby interface to sqlite3. It's a separate (easy) download and install from sqlite.org

cheers
alex

Dan Munk

1/27/2006 11:44:00 PM

0


Alex Fenton wrote:
> Dan Munk wrote:
> > Hello,
>
> > When I execute:
> > irb(main):001:0> require 'sqlite3'
> >
> > I get the following:
> >
> > LoadError: no such file to load -- sqlite3
> > from (irb):1:in `require'
> > from (irb):1
>
> Two suggestions:
>
> 1) It doesn't look like you've loaded rubygems before you tried to load the sqlite3 gem. If you want Ruby to load libraries from gems, say
>
> require 'rubygems'
>
> before you try and require sqlite3.
>
> You can make ruby do this automatically by using environment variable RUBYOPT, but you'll have to enable this yourself on OS X. Check the rubygems docs.
>
> 2) Make sure you have the sqlite3 library itself installed as well as the ruby interface to sqlite3. It's a separate (easy) download and install from sqlite.org
>
> cheers
> alex

Thanks for responding. If I can use the sqlite3 command to view and
modify existing databases do I still need to install the sqlite3
interface? In the gem list it appears that I have the ruby interface
installed, is that not the case?

Thanks again,

Dan

Alex Fenton

1/28/2006 3:13:00 PM

0

Dan Munk wrote:
> If I can use the sqlite3 command to view and
> modify existing databases do I still need to install the sqlite3
> interface?

Maybe. The command-line tool and the shared library aren't the same thing. Check in likely lib directories (below is on OS X 10.3 with sqlite and sqlite3 libs compiled from source)

SCIPIUS:~alex$ ls /usr/local/lib/libsql*
/usr/local/lib/libsqlite.0.8.6.dylib /usr/local/lib/libsqlite3.0.8.6.dylib
/usr/local/lib/libsqlite.0.dylib /usr/local/lib/libsqlite3.0.dylib
/usr/local/lib/libsqlite.a /usr/local/lib/libsqlite3.a
/usr/local/lib/libsqlite.dylib /usr/local/lib/libsqlite3.dylib
/usr/local/lib/libsqlite.la /usr/local/lib/libsqlite3.la

> In the gem list it appears that I have the ruby interface
> installed, is that not the case?

Yes.

alex