简体   繁体   English

运行任何rails或rake命令时,Bundler 2,Gemfile找不到错误

[英]Bundler 2, Gemfile not found error when running any rails or rake command

I am setting a new app, stack is: 我正在设置一个新的应用程序,堆栈是:

ruby: 2.6.1 (using rvm)
rails: 5.2.2
bundler: 2.0.1

Now thing is, bundler 2 doesn't use Gemfile at all, i have proper gems.rb and gems.locked and everything was working properly until i pulled some code from a co-worker which got merged. 现在的事情是,捆绑软件2根本不使用Gemfile ,我有正确的gems.rbgems.locked并且一切工作正常,直到我从合并的同事那里提取了一些代码。

Issue is whenever i run any rake or rails command i get this error: 问题是,每当我运行任何rakerails命令时,都会出现此错误:

/path/to/proj/Gemfile not found

I then even tried going back to old master when that code was not merged and issue is still there. 然后,当该代码未合并并且问题仍然存在时,我什至尝试回到原来的主机上。 So it is probably not something in the code i pulled. 因此,这可能与我提取的代码无关。 And issue seems persistent in different machines. 而且问题似乎在不同的机器上仍然存在。

I know there are other issues which have similar errors of Gemfile not found but those are mostly those which had wrong directory opened or some gem issued fixed by bundle update or gem update type commands, this is not that issue because. 我知道还有其他一些问题,这些问题Gemfile not found类似的Gemfile not found错误,但大多数是那些打开了错误目录或通过bundle updategem update type命令修复了某些gem的问题,这不是因为这个问题。 This is something else, because bundler 2 doesn't even need Gemfile . 这是Gemfile回事,因为捆绑程序2甚至不需要Gemfile

It looks like rails doesn't support using gems.rb and gems.locked . 看起来Rails不支持使用gems.rbgems.locked https://github.com/rails/rails/issues/31295 https://github.com/rails/rails/issues/31295

You could try what that guy did and edit some files, or you could rename your gems.rb back to Gemfile and gems.locked back to Gemfile.lock 您可以尝试使用该工具进行操作并编辑一些文件,也可以将gems.rb重命名为Gemfile并将gems.locked重命名为Gemfile.lock

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM