I installed ruby 2.1.0 and package pdfbeads on 32bit 12.04 last year following the blog , and it worked. Now it seems that I have installed ruby 2.2.0 on 64bit 14.04, but met the problem when installing pdfbeads.
Installing rvm and ruby:
I heard the ruby in Ubuntu repository does not work (but I don't know if that still applies), so I followed to install rvm and ruby. I am not sure if I did the right things in the following:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -L get.rvm.io | bash -s stableI originally first ran
curl -L get.rvm.io | bash -s stablefirst, but it asked me to run thegpgcommand before it.Then I add a line to ~/.bashrc:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scriptingAnd a couple of lines to ~/.bash_profile:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"Then I ran:
source ~/.rvm/scripts/rvm rvm requirements rvm autolibs disable $ rvm install 2.2.0 Already installed ruby-2.2.0. To reinstall use: rvm reinstall ruby-2.2.0it tells me I have installed ruby already, then I checked the output of the previous commands, and found that
curl -L get.rvm.io | bash -s stableseems already installed ruby. Then I ran:rvm --default use 2.2.0Did I install rvm and ruby correctly? Or is there some better way to do that?
Now I would like to install a package
pdfbeads:$ gem install pdfbeads Building native extensions. This could take a while... ERROR: Error installing pdfbeads: ERROR: Failed to build gem native extension. /home/t/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150322-21902-q15297.rb extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... no checking for pkg-config... yes checking for ImageMagick version >= 6.4.9... yes Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found checking for stdint.h... yes checking for sys/types.h... yes checking for wand/MagickWand.h... no Can't install RMagick 2.13.4. Can't find MagickWand.h. *** 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=/home/t/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME) extconf failed, exit code 1 Gem files will remain installed in /home/t/.rvm/gems/ruby-2.2.0/gems/rmagick-2.13.4 for inspection. Results logged to /home/t/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/rmagick-2.13.4/gem_make.out t@ocean:/h/t/./archives$ man gem No manual entry for gem See 'man 7 undocumented' for help when manual pages are not available.I follow this link suggestion to run
rvm install 2.2.0-devAfter it seems that I still have the same error:
$ gem install pdfbeads Building native extensions. This could take a while... ERROR: Error installing pdfbeads: ERROR: Failed to build gem native extension. /home/t/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150322-24037-mauac1.rb extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... no checking for pkg-config... yes checking for ImageMagick version >= 6.4.9... yes Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found checking for stdint.h... yes checking for sys/types.h... yes checking for wand/MagickWand.h... no Can't install RMagick 2.13.4. Can't find MagickWand.h. *** 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=/home/t/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME) extconf failed, exit code 1 Gem files will remain installed in /home/t/.rvm/gems/ruby-2.2.0/gems/rmagick-2.13.4 for inspection. Results logged to /home/t/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/rmagick-2.13.4/gem_make.outI wonder how I can install the
pdfbeadspackage?
Thanks!
15 Answers
To check if your version of ruby is set up correctly, you can use the following.
$ which ruby /path/to/ruby
$ ruby --version ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin13.0]In your case, it looks like ruby is setup fine.
Rvm is just a tool to help you manage your rubies. You'll know if you don't like it.
There are clues to why the installation of the gem failed. Particularly,
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no <------ There's your problem
checking for pkg-config... yes
checking for ImageMagick version >= 6.4.9... yesYou are missing a library that is required for the gem to build successfully.This solution suggests it's available in the repos. So, you should be able to install it with:
sudo apt-get install libmagickwand-devOnce that is done, you should be able to install the gem.
gem install pdfbeadsNote: I haven't tested this solution, and the more prudent reader might notice I'm not even using ubuntu here anymore. Leave a comment if this doesn't get you sorted.
1Try this. It worked for me:
sudo apt-get install ruby-dev
sudo gem install pdfbeadsReference:
I also recently came across this issue recently with RVM.
I tried installing Compass and it failed on the native binaries with a recent clean install of Ubuntu.
The solution was to reinstall the Ruby version (2.3.0) using an additional flag afterwards of --disable-binary which means you don't install the pre-compiled binaries that comes with RVM. This means your native binaries are compiled on your machine. This will take some time to complete.
So, if you are having this issue try:
rvm reinstall --disable-binary 2.2.0Be sure to update the ruby version to whatever version you are having the issue with
1When I run sudo apt install build-essential, then it works again.
Ubuntu 18.04, Ruby 2.5.1p57.
For WSL (Windows Subsystem for Linux) you need install build-essential package:
sudo apt install build-essential