Posted almost 9 years ago. Visible to the public.

Rubygems: Rebuild native extensions

Rarely, you might want to rebuild all gems with native extensions, because they might be compiled against outdated system libraries, resulting in some warnings or even segfaults or other ruby errors.

You can do that using

gem pristine --all

This will reset all gems to a pristine state as if you'd reinstall them, and as a side effect, rebuild all native extensions.

The above command will also help you sorting out errors like this after a distribution upgrade:

Copy cannot open shared object file: No such file or directory - /home/henning/.rvm/gems/ruby-1.8.7-p358/gems/mysql2-0.3.11/lib/mysql2/

(Because the library which is used to compile the gem doesn't exist anymore and you have to recompile it.)

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Tobias Kraze
Last edit:
about 6 years ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more