Problem requiring the RMagick gem with Ruby
I had the very same problem in Ruby 1.8.7 as you with 1.9.1. This is a way I've resolved it:
- Uninstall the rmagick gem if you have it (gem uninstall rmagick)
- Download http://rubyforge.org/frs/download.php/64917/RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip
- Unpack the zip to separate folder (e.g. C:\temp\rmagick)
- Install the ImageMagick-6.5.6-8-Q8-windows-dll.exe
- Unpack the rmagick-2.12.0-x86-mswin32.gem to separate folder (e.g. C:\temp\rmagick\gem)
- Extract the data.tar.gz to separate folder (e.g. C:\temp\rmagick\gem\data)
- Open rmagick.gemspec and remove the line with s.platform = "mswin32"
- Use "gem build rmagick.gemspec" to build the gem again (a "rmagick-2.12.0.gem" will be generated)
- Use "gem install rmagick --local" to install it.
Can gem install be configured to install executables outside /usr/bin/ by default?
See http://www.rubygems.org/read/chapter/11 and specify a ~/.gemrc
which defines a gemhome variable.
For example:
gemhome: /usr/local/rubygems
You can also place this file in /etc/gemrc
Alternatively you can set the GEM_HOME
env-variable:
$ export GEM_HOME=/tmp/gemtest
$ gem install bundler
$ ls /tmp/gemtest/bin/
bundle
Update (10 years later):
Andrey Rodionov below suggest using
gem: --bindir /usr/bin
Related Topics
Ruby: How to Write a Bang Method, Like Map
Ruby: Is Variable Is Object in Ruby
Ruby Conditional-Assignment and Private Methods
Commonmarker Gem Cannot Be Installed (Needed for Jekyll) MACos
Telling Bundler to Exclude Certain Gems from a Particular Gem's Installation
Ruby Refuses to Divide Correctly
Rails: Wkhtmltopdf Runtimeerror (Location of Wkhtmltopdf Unknown)
Database Cleaner Not Working in Minitest Rails
How to Disable All Form_For Input Fields in Ruby on Rails App
Getaddrinfo Error with Mechanize
Saml 2.0 Sso for Ruby on Rails
How to Get the Number of Elements Having Same Attribute in HTML in Watir
How to Connect to Browser Using Ruby Selenium Webdriver
Rails/Activerecord: Save Changes to a Model's Associated Collections