I try to bundle config gemfile Gemfile.sj and bundle config gemfile mypathtoit/Gemfile.sj
but it is not working ...
Unfortunately, by the time Bundler loads the config file, it is too late. You need to set the Gemfile using BUNDLE_GEMFILE=Gemfile.sj bundle install, or using bundle install --gemfile Gemfile.sj.
BUNDLE_GEMFILE=Gemfile.sj bundle install
bundle install --gemfile Gemfile.sj
I see that this issue is closed, but I think that it's worth taking a second look: either Bundler should not deceive users by including the gemfile key in the documentation, which would be fine but suboptimal, or it should read the config file before finding the Gemfile, which I believe is the better solution. Is there a reason that this is essentially "wontfix" in that neither of these options are worth implementing?
@praecipula feel free to submit a pull request to correct the documentation. While we would also accept a pull request to honor the config setting, the location of the config file is based on the location of the Gemfile, so that's not possible.
Correct bundle-config manpage
It is not possible to set BUNDLE_GEMFILE using bundle-config, so don't
tell users that it is. [#1315]
@wizztjh @praecipula FYI, I have a pull request to add this feature: #3320