Will bundler use precompiled system gems instead of recompiling?

303 views
Skip to first unread message

Brandon Dimcheff

unread,
Oct 11, 2010, 10:44:15 PM10/11/10
to ruby-bundler
I have an old rails 2.3 app that I had upgraded to use bundler 0.9.
It uses rmagick 1.15, which (at least on the server) is unable to
compile unless it's installed as root. With bundler 0.9, I manually
installed rmagick and then bundler would just use that precompiled
gem. With 1.0, bundler tries to recompile the rmagick gem and fails.
Is there a way to get bundler to pull that already built gem from
system gems instead of trying to recompile it, like it did with 0.9?

- Brandon

Andre Arko

unread,
Oct 12, 2010, 2:41:26 AM10/12/10
to ruby-b...@googlegroups.com
On Oct 11, 2010, at 7:44 PM, Brandon Dimcheff wrote:

> Is there a way to get bundler to pull that already built gem from
> system gems instead of trying to recompile it, like it did with 0.9?

As of 1.0, Bundler can either install to system gems or install to a specific path. If you use system gems (via `bundle install --system`), then it will not try to recompile. If you don't use system gems (via --deployment or --path), you will not be able to use the already-installed system gem. If you need to pass compilation options to bundler, you can do that using the new `bundle config` command.

— Andre

Brandon Dimcheff

unread,
Oct 18, 2010, 11:59:27 AM10/18/10
to ruby-b...@googlegroups.com
hmm, ok. I'm using the capistrano recipe for deployment now, so it
installs the gems into shared/bundler. I don't think that compiler
flags will help. RMagick 1.15 is just really weird and does stuff in
/usr during the install process, regardless of where the installed gem
goes.

I was able to solve my problem by copying the gemspec and the
installed gem from my system gems into their appropriate location in
shared/bundler. It's a pretty hacky solution to the problem, but it
works.

Was it a conscious decision to not use already installed system gems
when installing gems elsewhere? I wouldn't mind taking a stab at
making bundler copy over system gems instead of reinstalling if it
would be helpful to others, as long as there's not a good reason that
bundler doesn't operate this way.

- Brandon

> --
> You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
> To post to this group, send email to ruby-b...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-bundler...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-bundler?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages