1
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 3 years have passed since last update.

Dockerの環境構築でエラー文`find_spec_for_exe': Could not find 'bundler' の解決方法

Posted at

#Docker
ローカルでは環境構築はうまく言ってるが
Dockerで環境を作成する際に

docker-compose run web rails new . --force --database=mysql --skip-bundle
を実行すると
エラー文が以下のように出た。

/usr/local/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.2.15) required by your /hogehoge/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.2.15`
        from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
        from /usr/local/bin/bundle:23:in `<main>'

# 解決策

Dockerにbundlerがインストールされてない。

RUN gem install bundlerを追記すればいいとのこと。

gem install bundler:2.2.15と出ているがローカル環境にはbundlerはあるのになぜ・・・・
と思ったら
Dockerにbundlerがインストールされてないため出ているエラーだった。

Dockerfileに上記の記述を追記し、コマンドを再度打つことでエラーが解決できた。

1
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
1
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?