0
0

More than 1 year has passed since last update.

ruby3.1に上げたらrubyの外部コマンド起動がエラーになって途方に暮れたら

Posted at

ruby2.7を3.1に上げた時、それまで動いていたruby on railsのプログラム起動の仕組みが、起動時に

can't find executable rails for gem railties. railties is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)

というエラーで起動できなくなりました。

原因と対策はこちらのページに御世話になりました(感謝)。

おおたの物置
 bundle中に別のbundleを呼ぶと予期しない結果になる対策
https://ota42y.com/blog/2015/01/28/bundle-in-bundle/

こちらにあるようにruby3.1の直接の問題ではありませんが、
当方で起動をしかけていたのは別のrubyプログラム(プロセス監視)で、ruby3.1にした際に
net-smtpなどをGemfileで指定しなければならなくなり、それによって起動しようとしたrailsの方のGemfileを読んでくれなくなった、という因果関係でした。
時期的に移行でひっかかる人がいる可能性があるかと、ruby3.1をタイトルに入れた次第です。

なお、上記ページに書かれていた対策の Bundler.with_clean_env は has been deprecated とのことで、現在は Bundler.with_unbundled_env か Bundler.with_original_env が推奨とのメッセージが出ました。

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