Ruby environment construction (Windows)Error message
Installed ruby 2.4.9 using RubyInstaller2 with MSYS2 installer.
I checked the installation of Ruby by entering ruby -v at the command prompt.
Using Atom, I created a directory called index.rb in a folder called ruby_lesson.
Even if cd Desktop and cd ruby_lesson are executed at the command prompt, the following error code 1 is displayed.
Furthermore, even if ruby index.rb is executed, the command in the directory is not executed and the following error code 2 is displayed.
Applicable source code
Error code 1: The specified path cannot be found Error code 2: ruby: No such file or directory-index.rb (LoadError)
Answer # 1
cd Desktopmeans "Move the current directory to a directory called Desktop in the current directory".
An error occurs if there is no Desktop directory in the current directory.
ruby index.rbmeans "execute a file called index.rb in the current directory with ruby", so it is called index.rb in the current directory. If there is no file, an error occurs.
If you are working with files and directories that should be in the current directory, if you are a beginner, you should make sure they are in the current directory. You can check with the
dircommand. If it is not displayed with the
dircommand, it will not be there (although it may be a hidden file on Windows).
I think that there is a file called
index.rbin a folder called
In Explorer, with the folder
cmdin the part surrounded by the red frame below to open the command prompt with that as the current directory So, after confirming that
- [ruby on rails] i want to implement a follow function, but the like button is not displayed in the view
- ruby - [rails] follow function cannot be implemented
- ruby - when you edit the code only in the development environment when you require an external module, if you just reload the sc
- ruby on rails 5 - create a post list page for users who follow
- ruby on rails - the schedule set with rails gem whenever does not work (development environment: docker)
- ruby on rails - how to branch depending on the rails development environment
- ruby - why build a web app development environment locally
- ruby on rails 6 - put it in the follow function and want the value of @user = userfind(params[:id] to be the value of user_id
- ruby/ruby on rails prototype development environment