Actions
Bug #1902
closedApparent problem with sqlite3-ruby
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
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
Like0
Like0Like0