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

  • Home
  • SEARCH
  • 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 8094197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:43:29+00:00 2026-06-05T20:43:29+00:00

In hirb tutorial there’s an example for array: [[1,2], [2,3]] prints as +—+—+ |

  • 0

In hirb tutorial there’s an example for array:

[[1,2], [2,3]] 

prints as

+---+---+
| 0 | 1 |
+---+---+
| 1 | 2 |
| 2 | 3 |
+---+---+

But I can’t make it work after usual setting up:

require 'hirb'
=>true
>> Hirb.enable
=>nil

The arrays are still printed in usuall manner.

What does it require to print an array as a table?

  • 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-05T20:43:31+00:00Added an answer on June 5, 2026 at 8:43 pm

    This works for me:

    irb(main):001:0> require 'hirb'
    => true
    irb(main):002:0> Hirb.enable :output=>{"Array"=>{:class=>Hirb::Helpers::Table}}
    => true
    irb(main):003:0> [[1,2], [2,3]]
    +---+---+
    | 0 | 1 |
    +---+---+
    | 1 | 2 |
    | 2 | 3 |
    +---+---+
    2 rows in set
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've always thought this sort of thing ugly: require File.join(File.dirname(__FILE__), 'hirb/config') Is there a
I have a few specific questions. I have tried googling these but I get
I have an app deployed on Heroku. I can access the remote heroku console
I have installed both awsome print & hirb irb plugins to Ruby 1.9.2 through
Is there a way to require a ruby gem safely so as to not
I'm trying to get Hirb setup in my console. When i type: require 'hirb'
I have this in hi.rb require 'rubygems' require 'sinatra' get '/hi' do Hello World!
I'm looking to write an app for the shell, *nix mostly. And I'm currently
I have a method that does a paginated find call like.. 1 coll =
I want to build a console-based application with Ruby. I quick googled and found

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.