0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rails s(rails server)でエラーENOENTが出た件

Last updated at Posted at 2022-12-13

前提です

railsを導入して、rails sやろうと思った矢先に出たエラーです

初歩的すぎるのか、ネットで調べても出なかったので、載せようと思います。
初心者でつまずく人もいるんじゃないでしょうか。

問題点

アプリケーション内でrails sを起動してもエラーが出てしまう。

以下、環境

OS:Windows11
Ruby:3.1.3p185 (2022-11-24 revision 1a6b16756e) [x64-mingw-ucrt]
Rails:7.0.4

以下エラーコード


C:\Users\user\sample_app>rails s

C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/app_loader.rb:53:in `exec': No such file or directory - 
"C:/Program Files/Ruby31-x64/bin/ruby.exe" (Errno::ENOENT)
        from C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/app_loader.rb:53:in `block in exec_app'
        from C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/app_loader.rb:48:in `loop'
        from C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/app_loader.rb:48:in `exec_app'
        from C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/cli.rb:7:in `<top (required)>'
        from <internal:C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Program Files/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Program Files/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/exe/rails:10:in `<top (required)>'
        from C:/Program Files/Ruby31-x64/bin/rails:25:in `load'
        from C:/Program Files/Ruby31-x64/bin/rails:25:in `<main>'

原因

ダウンロードしたRubyのフォルダを、Cドライブのprogram files配下に置いていたのが原因。

解決策

RubyフォルダをCドライブに直接配置することで解決
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?