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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:47:31+00:00 2026-06-18T14:47:31+00:00

In my controller I am trying to execute a ruby script: def mymethod variable

  • 0

In my controller I am trying to execute a ruby script:

def mymethod
  variable = `ruby /home/user/Test.rb`
  exec variable
  raise "Failed: #{variable}" unless variable.blank?
end

Test.rb script is present in the mentioned path, even then i get an error:

Errno::ENOENT (No such file or directory - )

The Test.rb content:

require 'rubygems'
require 'net/smtp'
require 'pp'
require 'mysql'
require 'yaml'
message = "MESSAGE_END
G Name <MyEmailAddress>
To: G Name <MyEmailAddress>
Subject: SMTP e-mail test
This is a test mail"
Net::SMTP.start('webserver') do |smtp|
smtp.send_message message, 'EmailAddress', 'EmailAddress'
end

When I manually run this script. It sends the mail as expected.

  • 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-18T14:47:32+00:00Added an answer on June 18, 2026 at 2:47 pm

    You have to

    require 'open-uri'
    

    So,

    require '/home/user/Test.rb'  
    require 'open-uri'  # sometimes without this line, we get the exact error message in ruby on rails..
    

    (or)

    Try to reboot your server, sometimes its fix it..

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

Sidebar

Related Questions

I'm trying to load up rails in the test environment using a ruby script.
I am trying to unit test a controller action that uses UpdateModel but I
I am trying to test a Controller that has a Command object with data
I'm trying to execute my controller from javascript using jquery... here is my jquery
I am trying to test coffee script in my rails 3.1 project, but it
I am trying to test my controller and maintain separation of concerns. The first
I was trying to execute RedirectToAction(actionResult) from my base controller but IntelliSense didn't show
I am trying to create a user login system. I have a class/controller called
I'm trying get online friends by user in XMPP server (Ejabberd). I'm using Ruby
What is the best way to execute a codenighter controller/method from an external script?

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.