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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:55:49+00:00 2026-06-13T10:55:49+00:00

In trying to learn about Ruby execution methods, I found this blog post on

  • 0

In trying to learn about Ruby execution methods, I found this blog post on five ways to run commands in Ruby http://mentalized.net/journal/2010/03/08/5_ways_to_run_commands_from_ruby/

The author creates a file err.rb, which outputs two lines, one on STDOUT, the other on STDERR

#!/usr/bin/env ruby
puts "out"
STDERR.puts "error"

The first way he tries to run it is with Kernal#` (backticks)

 >> `./err.rb`

      err
=> "out\n"

The point this illustrates is that when run with backticks

STDERR is output, but not captured
STDOUT is captured

When I tried to duplicate this on my system, I got a permission error

localhost:sites mike$ `./err.rb`
-bash: ./err.rb: Permission denied

I tried sudo ./err.rb with no change.

I can run ruby err.rb but that produces a different result than what the author got. Namely by running ruby err.rb I get

  out
  error

Can someone explain why I’m getting a permission error trying to run it with backticks, and also generally what the whole purpose of running it with backticks is.

  • 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-13T10:55:50+00:00Added an answer on June 13, 2026 at 10:55 am

    Try add permission to execute, use “chmod +x that_file_name”
    to execute using format “./file” the ‘file’ need to have execute permission

    It runs when you ruby because ruby has execute permission and it simply read that file.

    Try this

    localhost:sites mike$ chmod +x err.rb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn about this feature of javascript I keep seeing in code,
I'm starting to learn more about the Ruby object model, and am trying to
I'm learning about Qt Model/View with Ruby and I'm trying run the following code
I'm currently trying to learn Ruby and I'm trying to understand more about what
I'm trying to learn about trees by implementing one from scratch. In this case
Trying to learn about php's arrays today. I have a set of arrays like
I'm trying learn more about RavenDB and at the moment to focus on how
I am trying to learn about the ScriptProperties object in GAS. I tried setting
I've been trying to learn about metaclasses in Python. I get the main idea,
I am currently trying to learn about OpenGL ES for the iPhone and following

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.