This time, as an example, consider Hello Ruby and a program that returns a message. Enter the following program with TeraPad and
kensyuu15.rb
Save as file name
~~~
print("Hello, Ruby.\n")
~~~
At this time, make sure you know exactly where you saved it.
It is an image that guides the way to the created file to a personal computer.
I saved it in a file called 20191219 in a file called Folder1 on my desktop.
## 2. Teach your PC the way to the saved file
Start Ruby.
Guide the desired file to your PC.
For the guidance method, write the places in order and separate them with /.
Add a cd at the beginning to mean go to that place
~~~
cd /mnt/c/Users/aiko/Desktop/Folder1/20191219
~~~
The above is when a user named aiko saves it in a file called 20191219 in a file called Folder1 on the desktop.
Then execute ls which means to see the contents
~~~
ls
~~~
With this, if the contents of 20191219 are displayed, it is OK
## 3. Run
~~~
Ruby kensyuu15.rb
~~~
↓ Result
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/551646/ef0aab17-0947-21f3-d1d8-f7e99f051b26.png)
Recommended Posts