Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on Ubuntu #352

Closed
davidsowerby opened this issue Mar 7, 2016 · 11 comments
Closed

Installation fails on Ubuntu #352

davidsowerby opened this issue Mar 7, 2016 · 11 comments

Comments

@davidsowerby
Copy link

I'm not familiar with Ruby, so I may be missing something simple ...

On Ubuntu 14.04, I installed Ruby:

sudo apt-get install ruby

That seemed to installed correctly
Attempted to install your gem:

sudo gem install github_changelog_generator

david@david-corsair:~$ sudo gem install github_changelog_generator
Fetching: rake-10.5.0.gem (100%)
Fetching: bundler-1.11.2.gem (100%)
Fetching: addressable-2.4.0.gem (100%)
Fetching: hashie-3.4.3.gem (100%)
Fetching: multipart-post-2.0.0.gem (100%)
Fetching: faraday-0.9.2.gem (100%)
Fetching: multi_json-1.11.2.gem (100%)
Fetching: jwt-1.5.1.gem (100%)
Fetching: multi_xml-0.5.5.gem (100%)
Fetching: rack-1.6.4.gem (100%)
Fetching: oauth2-1.1.0.gem (100%)
Fetching: thread_safe-0.3.5.gem (100%)
Fetching: descendants_tracker-0.0.4.gem (100%)
Fetching: github_api-0.13.1.gem (100%)
Fetching: colorize-0.7.7.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing github_changelog_generator:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:4:in `

'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.10/ext/ffi_c/gem_make.out

@olleolleolle
Copy link
Collaborator

@davidsowerby The issue seems to be a quite old ruby Debian package - http://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror

@olleolleolle
Copy link
Collaborator

@davidsowerby Thanks for your interest in github-changelog-generator! Do tell if using a newer Ruby worked for you.

@davidsowerby
Copy link
Author

@olleolleolle Thanks for the quick response. I'm hoping I can get this to work for me - your project seems to be doing exactly what I want.

Ubuntu is some way behind on Ruby versions. I used the Brightbox ppa instead, and installed Ruby 2.3:

david@david-corsair:~$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux-gnu]

But ... I am still getting an error

Building native extensions. This could take a while...
ERROR: Error installing github_changelog_generator:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.10/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160307-13830-qe7acb.rb 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/lib/gems/2.3.0/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.10/gem_make.out

@olleolleolle
Copy link
Collaborator

The ffi gem builds native extensions.

Kind souls on the Web explain this, too: jasmine/jasmine#755 (comment)

@davidsowerby
Copy link
Author

Ok, tried this:

sudo apt-get install gcc ruby ruby-dev libxml2 libxml2-dev libxslt1-dev
sudo gem install ffi

First command completed but references Ruby 1.9.1 and also has some suspicious output:

Setting up libruby1.9.1 (1:1.9.3.551-2bbox1trusty1) ...
Setting up libxml2-dev:amd64 (2.9.1+dfsg1-3ubuntu4.7) ...
Setting up libxslt1-dev:amd64 (1.1.28-2build1) ...
Setting up ruby1.9.1 (1:1.9.3.551-2bbox1
trusty1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/gem2.3 because link group gem is broken
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/ruby2.3 because link group ruby is broken
update-alternatives: warning: skip creation of /usr/share/man/man1/rake.1.gz because associated file /usr/share/man/man1/rake2.3.1.gz (of link group ruby) doesn't exist
update-alternatives: warning: skip creation of /usr/bin/testrb because associated file /usr/bin/testrb2.3 (of link group ruby) doesn't exist
Setting up ruby (1:1.9.3.4) ...
Setting up ruby1.9.1-dev (1:1.9.3.551-2bbox1~trusty1) ...
Setting up ruby-dev (1:1.9.3.4) ...

Second command generates a similar error to previous:

sudo gem install ffi
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.10/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20160307-16895-3cekqa.rb 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/lib/gems/2.3.0/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.10/gem_make.out

@olleolleolle
Copy link
Collaborator

@davidsowerby We've reached the point in this GitHub Issue where we're answering "How do I install Ruby on Ubuntu with development header files so that ffi can install native extensions?"

I'll close this Issue since it's no longer about this project, but about how to get up and running with gems with extensions on Ubuntu 14.04.

@davidsowerby
Copy link
Author

Ok, fair enough, thanks for your help this far ... I've been trying to find some reference to installing on Ubuntu but not found anything complete as yet. With luck, your summary of the problem will be enough to solve that:

how to get up and running with gems with extensions on Ubuntu 14.04

To someone unfamiliar with Ruby that's a useful piece of information

@olleolleolle
Copy link
Collaborator

@olleolleolle
Copy link
Collaborator

@davidsowerby Nokogiri is a common dependency which has extensions.

@davidsowerby
Copy link
Author

@olleolleolle Thanks for the thought - but I decided not to install Ruby just for this - much as I like the look of your project, it would introduce an unnecessary dependency, and one which is clearly not straightforward to manage.

I have a half-written alternative - I'll just need to finish the other half ... but thanks for your help

@olleolleolle
Copy link
Collaborator

@davidsowerby "It depends", as always. Best of luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants