Gitlab installation fails due to missing ruby-dev package
When installaing gitlab, the installation fails at various points. When running a manual bundle install the root cause is shown:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/local/git/gitlab/vendor/bundle/ruby/2.1.0/gems/version_sorter-2.0.0 for inspection.
Results logged to /var/local/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/version_sorter-2.0.0/gem_make.out
An error occurred while installing RedCloth (4.3.2), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.3.2'` succeeds before bundling.
Seems that the ruby-dev package is required for the native extension build to run.
Yes, it was installed previously by debops.ruby role but is not enabled by default. To fix it for now, you can set in the inventory:
ruby__packages: [ 'ruby-dev', 'build-essential' ]
I'm not sure what solution would be better - install ruby-dev in the debops.ruby role by default, or install it via specific roles like debops.gitlab. I suppose the second option seems to be better. I'll try to fix that as soon as possible in the debops.gitlab role.
I ran into the same pbl. but ruby2.1-dev does not include /usr/lib/ruby/include/ruby.h it includes: /usr/include/ruby-2.1.0/ruby.h
according to apt-file find, there is no /usr/lib/ruby/include/ruby.h in jessie & stretch
@chymian Do you have ruby-dev and build-essential packages installed? That should be enough to build Ruby native extensions on Jessie.
yes I do. ruby-dev does have no files in it, except some under /usr/share/doc/ruby-dev and a dependency on ruby2.1-dev, which gives /usr/include/ruby-2.1.0/
it seems that in jesse+ the header-files are all in /usr/include/* not in /usr/lib/*/include
I found debian bug# #739779 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739779#5 ... The full build log is available at: http://aws-logs.debian.net/ftbfs-logs/ruby-defaults/failed-logs/quickfix_1.13.3+dfsg-6_unstable.log.gz
Important changes from 1.9 to 2.0:
- location of ruby/config.h has changed; it's location is now available from: ruby -r rbconfig -e "print RbConfig::CONFIG['rubyarchhdrdir']"
- path for binary extensions has changed; it's location is now available from: ruby -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
@chymian Well, I don't know what to tell you... I routinely installed GitLab 8.11 with this role on Debian Jessie container multiple times this day, no issues. If you want, we could do a Hangouts or TeamViewer session where I could see your environment and what's happening.
@drybjed do you have an example for the gitlab installation? A bit unrelated, but I've been tackling that for the past few days and now running into some nginx errors regarding missing default.crt files from the PKI. This is off-topic so if there's any other way to discuss please let me know.
@yuvadm Right now all you need to do is configure in the inventory/hosts file:
[debops_all_hosts]
gitlab-server
[debops_service_mariadb_server]
gitlab-server
[debops_service_gitlab]
gitlab-server
Then, when you run the command debops -l gitlab-server on a fresh host, you should get it configured to support GitLab. If you want a bit different configuration (multiple hosts, PostgreSQL as a database, etc.) it will be more involved.
You should first make sure that the host works fine with the DebOps common playbook, after that it should let you install GitLab without much hassle.
If you want to talk more real time, come over to #debops channel on FreeNode. :-)
@drybjed I think we can close this one.