Project

General

Profile

Actions

Bug #1902

closed

Apparent problem with sqlite3-ruby

Added by mvi.bgs (BG Scott) over 14 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
ruby -v:
1.8.6 (2008-08-11 patchlevel 287)
[ruby-core:24798]

Description

=begin
Running ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] on Max OS X. When I run this script:

#! /usr/bin/ruby -w

require 'sqlite3'

p = SQLite3::Database.new("development.sqlite3")
p.execute( "select * from posts" ) do |row|
puts row
end
p.close

the following error message is displayed:

$ fetchDb
./fetchDb:3:in `require': no such file to load -- sqlite3 (LoadError)
from ./fetchDb:3

When the same script is entered via irb, it works properly. What's going on? I'm new to Ruby, Rails, and sqlite3.
=end

Actions #1

Updated by luislavena (Luis Lavena) over 14 years ago

=begin
No, the issue is that you installed sqlite3-ruby using RubyGems, thus you need:

require 'rubygems'
require 'sqlite3'

In your script.

This is not a bug.
=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0