Specify different sources for a gem

63 views
Skip to first unread message

Abdelkader Boudih

unread,
Sep 19, 2014, 12:06:36 PM9/19/14
to ruby-b...@googlegroups.com
Let have a scenario where i use a local version of rails, but use the rubygems one in production and test.
It is usefull if i want to place debugger breakpoints in the gem i have locally.

group :development do
  gem 'rails', path: '../rails'
end

group :production, :test do
 gem 'rails'
end

Right now if we want to specify 2 locations of the same gem we get this error :
You cannot specify the same gem twice coming from different sources.

Is there any way to do it without using a second Gemfile ?

Thanks

André Arko

unread,
Sep 19, 2014, 10:00:43 PM9/19/14
to ruby-b...@googlegroups.com
You should use Git Locals for this.

--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-bundler...@googlegroups.com.
To post to this group, send email to ruby-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-bundler.
For more options, visit https://groups.google.com/d/optout.

Tim Moore

unread,
Sep 21, 2014, 8:13:35 AM9/21/14
to ruby-b...@googlegroups.com
If all you want to do is set breakpoints and not actually make local changes to your gem, the easiest way is to use 'bundle open' to open up the installed gem directory in a text editor.

You can use 'bundle exec gem pristine <gemname>' to reinstall the gem and go back to the original code.

--
Reply all
Reply to author
Forward
0 new messages