I have been running my Ruby program using the Git Bash console for a while now.
Lately, when I wanted to run a simple ruby program, i go the following on the console:
c:\Ruby187\bin\ruby.exe: No such file or directory
Why is that? And, how can I solve this issue?
Thanks.
Check the PATH environment variable under both User and System.
Looks like it sees where it should be. Potentially a permissions issue? Can you run with a regular command prompt? Start->run, cmd.exe, ruby -v?
It seems that I had to explicitly save my ruby program with the extension .rb added at the end of the file name for this problem to disappear.
Thanks.
Related
I am trying to get Julia to run on VSCode on windows. I cannot get julia Language server to run. The executable path = "C:\Julia-1.1.1\bin\" which is the correct path. Where am I going wrong?
As stated in the parameter's description, the path should point to the julia executable. You need to add julia.exe to the end.
C:\Julia-1.1.1\bin\julia.exe
If you are editing the JSON file directly, you will need to escape the backslashes.
C:\\Julia-1.1.1\\bin\\julia.exe
The following setting works for me, without the .exe extension.
"julia.executablePath": "C:\\Users\\...\\Julia-1.3.0\\bin\\julia"
I have a ruby script that I run from the terminal, however I want to be able to double-click an icon like I would an application and run the script. I've looked at ruby-packer, but it isn't working for me.
What is the best option to accomplish this?
Im on a mac.
In terminal, I'm not at the directory of the .rb file because when I try to run ./rubyc from the directory containing the .rb file, I get the error command not recognized
When I run ./rubyc /RubyProjects/signOff.rb /signOff.out I'm able to get it to run, but the outfile file is called rubyc that just re-runs the same code when I double-click it. I'm at a loss for how to get it to work properly.
`
The -o parameter defines the output filename:
rubyc -o signOff signOff.rb
I was using Pycharm as my editor to run the scripts since i need to add a task scheduler i had to test the code on the command prompt. Firstly this is the structure of my project.
When i try to run the following line
C:\Users\My_name\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Users\My_name\PycharmProjects\FYP_CB006302\generateSummary.py"
I get this error,
From the knowledge i have i think it is because it doesn't recognize the path.
But when i change the directory to my project folder then give the path to python.exe and type generateSummary.py it works which was done as shown here.
However i highly doubt that this method can be used to task a schedule in Windows. Therefore, any ideas that would to run as shown in the beginning will be helpful.
The problem here is that when you use that line to run a particular script the folder which is causing the error is out of scope.
C:\Users\My_name\AppData\Local\Programs\Python\Python36-32\python.exe "C:\Users\My_name\PycharmProjects\FYP_CB006302\generateSummary.py"
In this case pickle_saves folder is out of scope. You can avoid this by giving a absolute path to that file in line 173. Where the absolute path is something like C:\user\documents\projects\pickle_saves\all_words
I am getting error when calling OS command for Peoplecode using EXEC function.
The call is like this
CommitWork();
&ShellCommand = "/path/mytest.sh param1 param2";
&ReturnCode = Exec(&ShellCommand, %Exec_Synchronous + %FilePath_Absolute);
The &ShellCommand is built using the path, executable and parameters
to be passed as shown above. That command works fine when executed
independently.
I keep getting error 255. Is there anything about the syntax? Does anybody have a tested or working example or any suggestion?
Thank you guys for responding. The command was running fine from shell scripts but not from Peoplesoft. It turned out that the current folder on the application server was not correct. So I added a CD command as the first line in the shell script to change current folder to the correct folder. That worked.
Thanks again.
the syntax looks correct.
I use similar code to call bat files.
Exec("C:\windows\system32\cmd.exe /c C:\Test\mybat.bat param1 param2", %Exec_Synchronous+%FilePath_Absolute);
Have you tried with an absolute path instead of a relative path?
error code 255 seems to be an out of range error code.
see http://tldp.org/LDP/abs/html/exitcodes.html
I would check the assumptions that you're making.
Is the same username running the shell script, your username vs the app server username?
Is the environment set up the same way for the app server username vs your username?
file permissions
This is a noob question at its best but Google isn't finding what I need.
I have a ruby script that I need to fire off via task scheduler. I thought I did it right by using the following:
cmd /k ruby test.rb
This works when starting the .bat file from the folder. However, if it runs from taskeng.exe it fails because its looking in my system32 folder. I don't want it to run from system32 so how do i format this to run from say, c:/dev/
Again, sorry for the extremely noob question.
You can leave out cmd of that and just use
ruby test.rb
or rather (in your case):
ruby C:\Users\Foo\test.rb
or something like that. Giving the complete path to the script usually helps in finding it ;-)
In any case, if you need the working directory you can set it in the scheduled task itself. Something akin to the following:
Likewise, if you actually need cmd in there. Just fill out the Start in field and you have a working directory.