Mac OS X configuration woes

D

Dan Munk

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.rubyforge.org

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
 
A

Alex Fenton

Dan said:
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
 
D

Dan Munk

Alex said:
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
 
A

Alex Fenton

Dan said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top