Multiple Gemfiles revisited

24 views
Skip to first unread message

Tim Uckun

unread,
Aug 16, 2014, 10:02:36 PM8/16/14
to ruby-b...@googlegroups.com
Similar questions like this come up on occasion but I haven't been able to dig up an answer to this question.

Here is what I want to do.

pid = fork do
    #some equivalent of bundle exec without using system calls
end

So the parent app has a Gemfile and is invoked with Bundle exec. The child apps have their own gemfiles but they also use some gems from the parent app so I don't want a subshell.

How can do do this?


Andre Arko

unread,
Aug 17, 2014, 11:03:19 PM8/17/14
to ruby-b...@googlegroups.com
There isn't any way to do that right now. Every approach that I've seen has the child include the parent Gemfile via something like `eval(File.read("../Gemfile"))`, and then the child is run using `Bundler.with_clean_env { system("bundle exec whatever") }.

Tim Uckun

unread,
Aug 17, 2014, 11:05:38 PM8/17/14
to ruby-b...@googlegroups.com

There isn't any way to do that right now. Every approach that I've seen has the child include the parent Gemfile via something like `eval(File.read("../Gemfile"))`, and then the child is run using `Bundler.with_clean_env { system("bundle exec whatever") }.


That's really disappointing. I have tried various things I have seen on this mailing list and stackoverflow and so far nothing has worked.  Seems like it would be a handy feature to have.
Reply all
Reply to author
Forward
0 new messages