运行捆绑安装后,docker-compose run命令无法找到gem

老友记

我正在为我的Rails应用程序使用docker-compose。

我最近提取了对我的master分支的更新,该更新将rails版本更新为5.2.3-并通过docker-compose进行了捆绑安装:

docker-compose run web bundle install

似乎运行良好,但是当我尝试运行rspec时,出现此错误:

Could not find activesupport-5.2.3 in any of the sources
Run `bundle install` to install missing gems.

我尝试运行bundle update activesupport-并获得以下信息:

Bundler attempted to update activesupport but its version stayed the same
Bundle updated!

因此,我尝试手动安装gem:

docker-compose run web gem install activesupport
Fetching activesupport-5.2.3.gem
Successfully installed activesupport-5.2.3
1 gem installed

然后,我尝试再次运行rspec,并且执行相同的操作:

$ docker-compose run web bin/rspec ./spec/some_spec.rb 
Could not find activesupport-5.2.3 in any of the sources
Run `bundle install` to install missing gems.

docker-compose是否未掌握gem / bundler的更改?我在这里想念什么吗?

米加尔

docker-compose run 每次调用都会创建一个新容器,您的更改不会持久。

如果您希望更改保留下来,请使用docker-compose exec,它将在正在运行的容器中运行命令。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章