'No such directory ruby.exec Errno:ENONT

I'm new to ruby on rails. I installed ruby, sqlite3, node and yarn, run gem install rails and gem install sqlite3.

when I run rails new <app_name>, I got this error.

D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/app_loader.rb:53:in `exec': No such file or directory - "D:/Program Files/Ruby30-x64/bin/ruby.exe" (Errno::ENOENT)

How can I fix it? Thank you.



Solution 1:[1]

You should install it under a path without space, so try to avoid "program files" folder.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Meng Zhang