LoginSignup
0
0

More than 1 year has passed since last update.

[Rails][shebang] bin/rails : No such file or directory 解決法

Posted at

問題

VM上のCentOS 環境からgit cloneした
Rails projectの bin/rails bin/rake などbinstabコマンドがうまく実行できない。

$ bin/rails console
: No such file or directory

->
bin/rails ファイル中身を 削って、見ると
そもそも1行もruby実行できていない

原因

shebang とよばれる1行目 の読み込みが悪いよう

一方で rails c
など 当のbinstab を使用しないと実行はできる:

$ rails c
/home/vagrant/.rbenv/versions/2.7.6/bin/ruby: warning: shebang line ending with \r may cause problems
..

( ->
改行コードが 悪いみたいなwarning が出ている..

解決法

全体的に改行コードが問題っぽいが、

とりあえず、
当binstab を以下でencode変換したら 解決した。

$ dos2unix bin/*

->

$ bin/rails c
..
irb > 

参考

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