Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7713027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:46:07+00:00 2026-06-01T01:46:07+00:00

Hi Im using Ruby as a scripting language. Not for web development, but to

  • 0

Hi Im using Ruby as a scripting language. Not for web development, but to connect to a local database on my computer and manipulate it.

Id like to know how I can connect. Do I need to download/import tools? What do I need to get started?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:46:08+00:00Added an answer on June 1, 2026 at 1:46 am

    You need to install the sqlite3 gem:

    gem install sqlite3
    

    You can then use the library in your code. Here’s an example, adapted from the project’s README.rdoc file:

    require 'sqlite3'
    
    # Open a SQLite 3 database file
    db = SQLite3::Database.new 'file.db'
    
    # Create a table
    result = db.execute <<-SQL
      CREATE TABLE numbers (
        name VARCHAR(30),
        val INT
      );
    SQL
    
    # Insert some data into it
    { 'one' => 1, 'two' => 2 }.each do |pair|
      db.execute 'insert into numbers values (?, ?)', pair
    end
    
    # Find some records
    db.execute 'SELECT * FROM numbers' do |row|
      p row
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Ruby as my main scripting language for years but switched to
How can I drive the debugging session with some scripting language like ruby? Is
I know a bunch of scripting languages, (python, ruby, lua, php) but I don't
I've been using Textmate for Ruby/Python scripting for awhile and now have a need
Question: Using Ruby it is simple to add custom methods to existing classes, but
Using Ruby on Rails 3: I semi-understand how accepts_nested_attributes_for is supposed to work, but
using ruby 1.9.2 and rails 3, i would like to limit the fields returned
So I'm aware of the big ammount of general-purpose scripting languages like Ruby, Python,
I'm thinking about using Python as an embedded scripting language in a hobby project
I am a Java/C++ programmer and Ruby is my first scripting language. I sometimes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.