require sqlite?

J

Jamal Soueidan

Hi,

I wonder why I cannot require sqlite in my ruby app.

$ ruby app.rb
app.rb:3:in `require': no such file to load -- sqlite3 (LoadError) from
app.rb:3

But it's working in the console? that's weird!
=> true

What can be the problem?

Thanks :)
 
L

Lars Christensen

I wonder why I cannot require sqlite in my ruby app.
What can be the problem?

I guess you have it installed as a gem. Try either:

require 'rubygems'
require 'sqlite3'

or the RUBYOPT environment set:

$ export RUBYOPT=-rubygems
 
B

Bernie Loriaga

Jamal said:
Hi,

I wonder why I cannot require sqlite in my ruby app.

$ ruby app.rb
app.rb:3:in `require': no such file to load -- sqlite3 (LoadError) from
app.rb:3

But it's working in the console? that's weird!

=> true

What can be the problem?

Thanks :)

I hope this can solve your problem...
http://sqlite-ruby.rubyforge.org/

Good day,
Bernie Loriaga
 
J

Jamal Soueidan

Lars said:
I guess you have it installed as a gem. Try either:

require 'rubygems'
require 'sqlite3'

or the RUBYOPT environment set:

$ export RUBYOPT=-rubygems

Thanks, that fixed my problem :)
 

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

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top