Ruby net: SSH command not found

Source: Internet
Author: User

 

 
  Chmod777 *. Sh

 

 

Yesterday afternoon I 've been debugging How to Use Net: SSH in Ruby to call Linux script files.

The basic Linux Command is okay, and the returned value is OK, that is, the newly added sh file cannot be called, prompting command not found

After searching for a long time, it was basically found that the environment variable could not be used, but the absolute path could not be written directly, and the result would still not work ....

Prompt Java: Command not found

This is a problem with Java environment variables.

The result is to modify the environment variables of the logged-on user in Linux. Check that the configuration is also configured. In the end, compare it with the previous SH, and then specify the environment variables in Sh.

Ah, it turned out to be so simple. I had to spend the afternoon on myself. I am not familiar with Linux .....

 

Set environment variables in the sh script

 

  #! /Bin/sh

Java_home="/Usr/Alibaba/java6"

Export path=$ Java_home/Bin:$ Path

 

Then you need to set the permissions for an SH file.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.