I installed ruby 2.1.0 and package pdfbeads on 32bit 12.04 last year following the blog https://railssavvy.wordpress.com/2012/06/02/install_ruby_and_rails/, 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 https://railssavvy.wordpress.com/2012/06/02/install_ruby_and_rails/ 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 stable
I originally first ran
curl -L get.rvm.io | bash -s stable
first, but it asked me to run thegpg
command before it.Then I add a line to ~/.bashrc:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
And 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.0
it 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 stable
seems already installed ruby. Then I ran:rvm --default use 2.2.0
Did 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 https://askubuntu.com/a/528798/1471 suggestion to run
rvm install 2.2.0-dev
After 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.out
I wonder how I can install the
pdfbeads
package?
Thanks!
sudo apt-get install libmagickwand-dev
was what fixed the problem for me! – GDP2 Feb 17 '22 at 10:52