Skip to content

Installation fails on Ubuntu 15.10 #21

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

Closed
vogella opened this issue Jan 26, 2016 · 6 comments
Closed

Installation fails on Ubuntu 15.10 #21

vogella opened this issue Jan 26, 2016 · 6 comments
Assignees

Comments

@vogella
Copy link
Contributor

vogella commented Jan 26, 2016

I followed the installation instructions successfully until the bundle command. This command fails with the error from below.

My next attempt will be to try the steps in a Docker Fedora container. I update the issue once I have done this, unfortunately I'm travelling currently and my wifi is very slow.

vogella@Frodo:~/git/docbookrx$ bundle
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...

Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

  bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.

Password:
Installing rake 10.4.2
Installing diff-lcs 1.2.5
Installing mini_portile2 2.0.0
Installing rspec-support 3.4.1
Using bundler 1.11.2
Installing nokogiri 1.6.7.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 extconf.rb --use-system-libraries

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 /tmp/bundler20160126-24774-6780kenokogiri-1.6.7.2/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /tmp/bundler20160126-24774-6780kenokogiri-1.6.7.2/extensions/x86_64-linux/2.1.0/nokogiri-1.6.7.2/gem_make.out
Installing rspec-core 3.4.1
Installing rspec-expectations 3.4.0
Installing rspec-mocks 3.4.1
An error occurred while installing nokogiri (1.6.7.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.6.7.2' succeeds before bundling.
vogella@Frodo:~/git/docbookrx$ sudo gem install nokogiri -v '1.6.7.2'
[sudo] password for vogella:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
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/lib/gems/2.1.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.7.2/gem_make.out

@mojavelinux
Copy link
Member

In order to install Nokogiri, which is one of the dependencies of DocBookRx, you must have the development headers installed on your machine. On Ubuntu, these can be installed using:

sudo apt-get install build-essential

On Fedora, you need:

sudo yum install -y gcc ruby-devel zlib-devel

I'm willing to add this information to the README. But it might just be best to link to the page on Nokogiri's site. See http://www.nokogiri.org/tutorials/installing_nokogiri.html

The fact that you have to use sudo to install gems on Ubuntu, in my opinion, reflects the fact that the Ruby setup is fundamentally broken on Ubuntu. The README definitely assumes that you are able to install Ruby gems correctly on your system. We simply can't cover that in every README. But that is why I have suggested that we create a general tutorial on asciidoctor.org that covers setting up Ruby for which we can reference. We do want to provide this information, but at the ecosystem level. See asciidoctor/asciidoctor.org#399.

@mojavelinux
Copy link
Member

This is also why I strongly recommend using RVM. I can't overemphasize how strongly I recommend RVM. When you are using Ruby for development (and otherwise in user space), you should not be interacting with the system Ruby. The system Ruby is for system things. If you are using "sudo" to install gems, you are mucking with the system Ruby and venturing into dangerous territory.

@vogella
Copy link
Contributor Author

vogella commented Jan 27, 2016

AFAIK I tried using rvm but at some point adding sudo was required to
continue with installation.
Am 27.01.2016 12:34 vorm. schrieb "Dan Allen" notifications@github.com:

This is also why I strongly recommend using RVM. I can't overemphasize
how strongly I recommend RVM. When you are using Ruby for development (and
otherwise in user space), you should not be interacting with the system
Ruby. The system Ruby is for system things. If you are using "sudo" to
install gems, you are mucking with the system Ruby and venturing into
dangerous territory.


Reply to this email directly or view it on GitHub
#21 (comment)
.

@mojavelinux
Copy link
Member

That tells me that rvm isn't active. After you install rvm, you must setup a default Ruby

rvm use 2.3 --default

You only need the --default flag the first time.

You can always check that RVM is active by running:

rvm current

If it says "system", you aren't using RVM.

@mojavelinux
Copy link
Member

RVM never requires that you use sudo to install gems.

@mojavelinux mojavelinux added this to the support milestone May 22, 2016
@mojavelinux mojavelinux self-assigned this May 22, 2016
@mojavelinux
Copy link
Member

I've upgrade Nokogiri in e685a4f, so this should now be resolved.

@mojavelinux mojavelinux removed this from the support milestone Oct 12, 2023
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