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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:14:03+00:00 2026-06-13T09:14:03+00:00

this is my script #!/usr/bin/env ruby require ‘sqlite3’ print Content-type: text/html\r\n\r\n print <html><body>Hello Stack

  • 0

this is my script

#!/usr/bin/env ruby
require 'sqlite3'
print "Content-type: text/html\r\n\r\n"
print "<html><body>Hello Stack Overflow<p></body></html>\r\n"

database = SQLite3::Database.new( "new.database" )
database.execute( "create table new_table (id INTEGER PRIMARY KEY, content TEXT);" )

database.execute( "insert into new_table (content) values ('this is a stack')")
database.execute( "insert into new_table (content) values ('this is overflow')")

rows = database.execute( "select * from new_table" )

p rows

This works but prints the rows in one line. I want to add a line break but I don´t know how.
html tag

doesn´t work, \n neither.

Can you help?

  • 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-13T09:14:05+00:00Added an answer on June 13, 2026 at 9:14 am

    <br> will do the work, since you are printing HTML.

    rows.each do |row|
       print row + '<br>'
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understand the script presented on this site : #!/usr/bin/env ruby require
I've got a ruby script myscript.sh like this #!/usr/bin/env ruby puts 'do some ruby
I've narrowed the problem down to the following simple code snippet: #!/usr/bin/env ruby print
If I run this script: (Note: edited to reflect answer 1) #!/usr/bin/env zsh setopt
This isn't working in ruby and I don't understand why? #!/usr/bin/env ruby exec sort
I have this script, works ok: #!/usr/bin/perl $key = pack(H*,3cb37efae7f4f376ebbd76cd); $str = &4\=80CHB'; $dec
So I call this PHP script from the command line: /usr/bin/php /var/www/bims/index.php projects/output and
I've got this simple Perl script: #! /usr/bin/perl -w use strict; use Data::Dumper; my
I have a Ruby executable (it's a bundler binstub) which starts with #!/usr/bin/env ruby
The following script: #!/usr/bin/env python from fabric.api import env, run import logging logging.getLogger().setLevel(logging.INFO) env.host_string

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.