engineyard / engineyard-jenkins

This project is deprecated in favour of eycloud-app-jenkins.
https://github.com/engineyard/eycloud-app-jenkins/
28 stars 6 forks source link

build fails installing linecache19 gem on a ruby 1.9 server #10

Open howcast opened 13 years ago

howcast commented 13 years ago
Using ruby_core_source (0.1.5) 
Installing linecache19 (0.5.12) with native extensions /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /usr/bin/ruby19 extconf.rb 
checking for vm_core.h... no
checking for vm_core.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby19
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/lib
/usr/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Permission denied - /usr/include/ruby-1.9.1/ruby-1.9.2-p180 (Errno::EACCES)
    from /usr/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
    from /usr/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
    from /usr/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
    from /usr/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
    from /usr/lib/ruby/1.9.1/fileutils.rb:201:in `each'
    from /usr/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
    from /usr/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core'
    from /usr/lib/ruby/1.9.1/tempfile.rb:320:in `open'
    from /usr/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
    from extconf.rb:19:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz

Gem files will remain installed in /home/deploy/.bundler/tmp/9662/gems/linecache19-0.5.12 for inspection.
Results logged to /home/deploy/.bundler/tmp/9662/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `block in build_extensions'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `each'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `build_extensions'
    from /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19:in `<main>'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
raygunsix commented 13 years ago

You can work around this problem by manually installing the gem:

deploy@ip-10-160-242-232 /data/jenkins-ci $ sudo gem install linecache19 Building native extensions. This could take a while... Successfully installed linecache19-0.5.12 1 gem installed

jurisgalang commented 13 years ago

Essentially how I solved it that day. There were also a couple of directories which should have been writeable by the deploy user but wasn't.

Anyway, we've since rebuilt the slice, and the issue did not come up (no manual install necessary) - the updates from EY must have fixed it.

BryanStarbuck commented 13 years ago

I solved this by running these two commands:

sudo bundle install bundle install

The first, built code outside of ~ and needed more access. The second worked because the core dependencies outside of ~ were now finished. I found that my installation can use the user's version of gems.