0

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.

Issue is whenever i run any rake or rails command i get this error:

/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. This is something else, because bundler 2 doesn't even need Gemfile.

Zia Ul Rehman Mughal
  • 2,119
  • 24
  • 44

1 Answers1

1

It looks like rails doesn't support using gems.rb and gems.locked. 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

  • Thanks for the link, don't know why i missed this one in my google search. It fixed the issue, thanks – Zia Ul Rehman Mughal Mar 05 '19 at 18:42
  • BTW, i don't know why, but appending rails with bundle exec was also making it work somehow. – Zia Ul Rehman Mughal Mar 05 '19 at 18:43
  • hmm, if running it with bundle exec makes it work, then it seems like its just defaulting to the wrong bundler version or something. `bundle exec` ensures that it runs the command in the right bundler context, you can see https://stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-mean for some more details if you want – baseballlover723 Mar 05 '19 at 19:20