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 113851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:46:03+00:00 2026-05-11T02:46:03+00:00

The following code gives a segmentation fault on the last line require ‘rubygems’ gem

  • 0

The following code gives a segmentation fault on the last line

require 'rubygems' gem 'mysql' gem 'dbi' require 'dbi' require 'mysql'  dsn = 'DBI:Mysql:DATABASE:www.HOST.net' # redacted dbh = DBI.connect(dsn, 'USERNAME', 'PASSWORD') # redacted  sth = dbh.execute('select  * from TABLE where numeric_value is not null limit 10;') # redacted 

It’s definitely the last line that’s causing the problem — a print statement on the next line doesn’t ever get executed.

Does anyone know why such a simple attempt would fail?

I’m running this on Windows, in case that makes a difference.

  • 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. 2026-05-11T02:46:04+00:00Added an answer on May 11, 2026 at 2:46 am

    This could be any number of things, from the version of DBI, Mysql gem, mysql version, and ruby version.

    Unfortunately ruby isn’t a first class citizen on windows, nor are all configurations tested extensively on it.

    First enable debugging on your VM to reproduce this issue with more information about where and why the segfault is happening. Pass the -d option the VM. From there you will hopefully have more info to where to look for the solution.

    I’d suggest, check your patch level of your VM

    ruby --version 

    I’d also check the level of DBI, and Mysql

      # if you are using gems   gem list --local  

    You could also switch how you are accessing Mysql, ActiveRecord uses it’s own code to connect to mysql, which is more extensively tested. May not be the best solution but should not rule it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Executing the below code gives me the following exception on the last line: InvalidOperationException:
The following piece of code gives a segmentation fault when allocating memory for the
The following C Code gives a segmentation fault: #include <stdio.h> #include <stdint.h> int main(){
Why does the following code give me a segmentation fault? #define MAXROWS 10 #define
The following code gives segmentation error when compiled with pgf90 on the Linux system,
Why is the following code giving segmentation fault? #include <stdio.h> #include <stdlib.h> int main()
The following code gives me this error Token Error: EOF in multi-line statement. What
The following code gives a NullReferenceException since XPathSelectElement can't navigate through the XPath expression
In C++ the following code gives a compiler error: void destruct1 (int * item)
The following code in javascript gives me the error this.callback is not a function

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.