Closed vogella closed 11 months ago
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 https://github.com/asciidoctor/asciidoctor.org/issues/399.
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.
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 https://github.com/opendevise/docbookrx/issues/21#issuecomment-175293138 .
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.
RVM never requires that you use sudo to install gems.
I've upgrade Nokogiri in e685a4fb703b75a784c8d9ac80c2462dcd8704bd, so this should now be resolved.
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:
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.
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.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