0

when i try to run a bundle install on a catarse project on my VPS, many of the gems needed for this project returns errors and i can't install (i'm using: ruby 1.9.2p320).

for example the gems thats return error are:

  • thin
  • eventmachine
  • linecache19

the error is always something that begins with:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

and ends with:

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.2-p320@catarse/gems/linecache19-0.5.12 for inspection.
 Results logged to /usr/local/rvm/gems/ruby-1.9.2-p320@catarse/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
 An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
 Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.

can you help to figure out?

DavideCariani
  • 273
  • 7
  • 21

1 Answers1

0

Some gems need to be built locally rather than simply downloaded. This means that some of the code in the gem is written in something other than ruby (usually C). The non-ruby code needs to be compiled and built locally in order to run. In those cases you'll need an environment that is capable of compiling and building that non-ruby code.

There's a good post about native gems here : http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions.

In cases like these it is usually question of tracking down which libraries need to be installed locally in order to build the gem.

I am aware of some issues with linecache19 and there are questions out there that address these, for example : Installing linecache19 for Ruby 1.9.2 via rvm.

Community
  • 1
  • 1
Shadwell
  • 34,314
  • 14
  • 94
  • 99
  • when you say "built locally" do you mean downloaded from git manually with .zip then unzip the gem into a driectory on my server, go there and run the command: gem build GEMNAME.gemspec gem install gemname-version.gem – DavideCariani Oct 16 '12 at 10:19
  • I've updated the answer to provide more details about building a gem in this case. – Shadwell Oct 16 '12 at 10:44