Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Newbie question 'require'

Reply
Thread Tools

Newbie question 'require'

 
 
Serg Koren
Guest
Posts: n/a
 
      01-29-2008
Hi I've installed the sqlite3-ruby gem via gem install. However =20
when I do a:

require 'sqlite3'

I get a LoadError: no such file to load =97 sqlite3. This is on Mac =20=

OSX 10.5.2. Yes I have slite3 installed and working. I checked the =20=

gems directory and the sqlite3.rb file exists. I'm obviously missing =20=

something obvious.

Any pointers would be appreciated.

S


 
Reply With Quote
 
 
 
 
Thomas Wieczorek
Guest
Posts: n/a
 
      01-29-2008
On Jan 30, 2008 12:45 AM, Serg Koren <> wrote:
>
> I get a LoadError: no such file to load =97 sqlite3. This is on Mac
> OSX 10.5.2. Yes I have slite3 installed and working. I checked the
> gems directory and the sqlite3.rb file exists. I'm obviously missing
> something obvious.
>


Try adding
require 'rubygems'

 
Reply With Quote
 
 
 
 
Serg Koren
Guest
Posts: n/a
 
      01-30-2008
That did it!
Thanks much...told you it was a newbie question
S

On Jan 29, 2008, at 6:52 PM, Thomas Wieczorek wrote:

> On Jan 30, 2008 12:45 AM, Serg Koren <> wrote:
>>
>> I get a LoadError: no such file to load =97 sqlite3. This is on =

Mac
>> OSX 10.5.2. Yes I have slite3 installed and working. I checked the
>> gems directory and the sqlite3.rb file exists. I'm obviously missing
>> something obvious.
>>

>
> Try adding
> require 'rubygems'
>



 
Reply With Quote
 
Thomas Wieczorek
Guest
Posts: n/a
 
      01-30-2008
On Jan 30, 2008 1:02 AM, Serg Koren <> wrote:
> That did it!
> Thanks much...told you it was a newbie question
>


You're welcome! I had the problem a few month ago, when I installed
Ruby on Windows without admin rights. Had to include that, because the
RUBYOPT enviroment variable didn't exist. Write -rubygems in it and
you don't have to require them every time.

Have fun with Ruby!

 
Reply With Quote
 
Tim Hunter
Guest
Posts: n/a
 
      01-30-2008
Serg Koren wrote:
> Hi I've installed the sqlite3-ruby gem via gem install. However when
> I do a:
>
> require 'sqlite3'
>
> I get a LoadError: no such file to load — sqlite3. This is on Mac OSX
> 10.5.2. Yes I have slite3 installed and working. I checked the gems
> directory and the sqlite3.rb file exists. I'm obviously missing
> something obvious.
>
> Any pointers would be appreciated.
>
> S
>
>


When you install a gem you must use RubyGems to load it as well. Did you
enable RubyGems in your pgm before reequiring sqlite3? The simplest
(tho' least robust) way is to add

require 'rubygems'

at the top of your program.
--
RMagick: http://rmagick.rubyforge.org/
RMagick 2: http://rmagick.rubyforge.org/rmagick2.html

 
Reply With Quote
 
Markus Arike
Guest
Posts: n/a
 
      01-30-2008
Tim Hunter wrote:
> Serg Koren wrote:
>> Any pointers would be appreciated.
>>
>> S
>>
>>

>
> When you install a gem you must use RubyGems to load it as well. Did you
> enable RubyGems in your pgm before reequiring sqlite3? The simplest
> (tho' least robust) way is to add
>
> require 'rubygems'
>
> at the top of your program.


You could also add,

export RUBYOPT=rubygems

to your .profile file. This is the solution I use as I avoid having to
type require 'rubygems'

on every script that has a gem lib file as a dependency.

If you don't know how to set environment variables in BASH, google would
be a good start.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Newbie! I'm a newbie! What's wrong with this program? Id0x Python 4 07-20-2003 11:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57