Passenger, RoR + Apache Bundler:Gemnotfound - ruby-on-rails

I'm trying to set up my own VPS (Ubuntu 14.04), and have almost succeeded (I hope!).
I'm using passenger, Rails and Apache. When I browse to my IP, I get a bundle GemError, though when I run bundle install on my machine it tells me it's using all gems.
The problem first occurred with the json gem, which is the first gem. When I manually added "gem json, 1.8.3" to my Gemfile, the error went to the second gem of the list, minitest.
There are two weird messages on top which might be the problem, but I do not really understand those messages:
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Could not find minitest-5.6.1 in any of the sources (Bundler::GemNotFound)
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/spec_set.rb:92:in `block in materialize'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/spec_set.rb:85:in `map!'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/spec_set.rb:85:in `materialize'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/definition.rb:140:in `specs'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/definition.rb:185:in `specs_for'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/definition.rb:174:in `requested_specs'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/environment.rb:18:in `requested_specs'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:13:in `setup'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler.rb:127:in `setup'
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/setup.rb:18:in `<top (required)>'
/usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:399:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:277:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:404:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:99:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'

Passenger author here. This error usually means one of two things:
Your app isn't being run as the user that it's supposed to be run as. Please set passenger_user to explicitly specify a user.
Your app isn't being run with the Ruby interpreter that it's supposed to be run as. Please set passenger_ruby to explicitly set a path to the Ruby interpreter that is supposed to be used.
If all fails, try our new end-to-end deployment walkthrough. It should work guaranteed (assuming you are starting from scratch and using the latest Passenger version).

Related

Every Rails command fails epically

I recently ran into a problem and in desperation decided to uninstall and reinstall both Ruby and Rails on my OS X 10.6. I've reinstalled Ruby and gem installed rails. Now, though, I get this error or similar EVERY time I try to run a rails command (even -v):
rails -v
/Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find bcrypt-ruby-3.0.1 in any of the sources (Bundler::GemNotFound)
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p1
25#global/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:9:in `<main>'
ANy ideas on how to fix this?
It seems like you need to install bcrypt-ruby
Maybe try sudo gem install bcrypt-ruby?
Run bundle install then run bundle exec rails -v see if this clears the issue.

Can’t run rails server

I’m working on getting my first rails application, but for whatever reason, when I run the command $rails server, my terminal throws back this error:
/Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'jquery-rails (= 2.0.0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/Toni/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:9:in `<main>'
I can’t find anything here on Stack Overflow. Any ideas?
You need to install the required gems that are used by Rails when started. Before you run rails s be sure to run bundle install or bundle update.
Make sure your Gemfile has a line that looks like: gem 'jquery-rails'
Then from your project's directory: bundle install
Because on Rubygems server, that version shows:
2.0.0 December 20, 2011 yanked

How to install a Rails application when using RVM?

I've followed instructions from this question on SO to set up RVM, rubies and gem lists.
I have created rubies 1.8.7 and 1.9.3. For the ruby 1.8.7 I have created a gemset called Organisator.
I have activated the 1.8.7 ruby and gemset "Organisator".
I navigated to the folder of my app and tried to run bundle install. I assume that's how I'm supposed to install the gems needed for my app, same way I did when I did not have RVM.
Error message I get:
root#user-VirtualBox:/home/user/RoR/testapp# bundle install
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- openssl (LoadError)
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/https.rb:102
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:135:in `fetch'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:163:in `fetch_dependency_remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:122:in `fetch_remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:70:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:234:in `remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:165:in `fetch_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:70:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/lazy_specification.rb:53:in `__materialize__'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:86:in `materialize'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `map!'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `materialize'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:127:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:122:in `resolve_remotely!'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:48:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:12:in `install'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/cli.rb:220:in `install'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/base.rb:386:in `start'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/bin/bundle:13
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/bin/bundle:19:in `load'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/bin/bundle:19
I also get an error message when I try to create a new app:
root#user-VirtualBox:/home/user/RoR# rails new testapp
/usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30:in `require': no such file to load -- active_support (LoadError)
from /usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30
from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16:in `require'
from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16
I assume I've done something wrong when setting up RVM.
The only idea I have right now is installing all the gems from my gemfile and adding them to gemfile manually.
Versions
Ruby 1.8.7-p358
Rails 2.3.1.4
RVM 1.10.3
Ubuntu 11.10
please use the "quick fix" from here https://rvm.io/packages/openssl/
you have to ignore the rest of instructions, they are intended for systems that do not support packages (like osx)

Gitorious Git-daemon Ruby Gem Error

I'm installing gitorious on my webserver. Everything works fine except git-deamon, I get the following error when I run it
/etc/init.d/git-daemon start
Starting git-daemon: /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:31:in `setup':
You have already activated daemons 1.1.4, but your Gemfile requires daemons 1.1.0.
Consider using bundle exec. (Gem::LoadError)
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:17:in `setup'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler.rb:107:in `setup'
from /var/www/gitorious/script/../config/../config/preinitializer.rb:16
from /var/www/gitorious/script/../config/boot.rb:28:in `load'
from /var/www/gitorious/script/../config/boot.rb:28:in `preinitialize'
from /var/www/gitorious/script/../config/boot.rb:10:in `boot!'
from /var/www/gitorious/script/../config/boot.rb:123
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from /var/www/gitorious/script/../config/environment.rb:11
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from /var/www/gitorious/script/git-daemon:11
failure
I have installed enterprise ruby 1.8.7 and ruby gems 1.4.2. I'm running ubuntu 11.04.
How could i solve it?
Thanks
The easy way (but not very future-proof):
gem uninstall daemons
cd /var/www/gitorious
bundle install
The hard way: modify /etc/init.d/git-daemon so that it runs cd /var/www/gitorious && bundle exec /var/www/gitorious/script/git-daemon start

Problem with rails when trying to do rails-v

My friend just shared me this new application and I pulled it from heroku
I was just trying to do rails -v and I got
denniss$ rails -v
/Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:132:in `block in resolve': Could not find gem 'selenium-webdriver', required by 'capybara', in any of the sources (Bundler::VersionConflict)
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:130:in `catch'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:130:in `resolve'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:153:in `resolve'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:93:in `specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:137:in `specs_for'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:126:in `requested_specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:11:in `setup'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler.rb:95:in `setup'
from /Users/denniss/Sites/mogo-production/config/boot.rb:5:in `<top (required)>'
from script/rails:8:in `require'
from script/rails:8:in `<main>'
Edit:
I did "bundle check" and I got this
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:214:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem'
from /usr/bin/bundle:18
Edit2:
Okay, the most up to date error that I gate after successfully installing rmagick is this. I was able to do rake db:create and migrate. I tried to do rails server (using rails3) and I get this error
/Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing': uninitialized constant ActiveSupport::CoreExtensions (NameError)
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/facebooker-1.0.74/lib/facebooker/adapters/adapter_base.rb:6
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/facebooker-1.0.74/lib/facebooker.rb:259
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:64:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:64:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:62:in `each'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:62:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:51:in `each'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:51:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler.rb:107:in `require'
from /Users/denniss/Sites/mogo-production/config/application.rb:5
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:28:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:28
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:27:in `tap'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:27
from script/rails:9:in `require'
from script/rails:9
The application requires a gem that isn't installed, in this case "selenium-webdriver." Try bundle check to see if there are additional errors, then proceed to install the gems you're missing.
Edit from comments:
In your first code block you're using MRI 1.9, then you moved on to MRI 1.8 and now you're suddenly using REE. That tells me that you've got (at least) three different Ruby interpreters on your computer, which isn't making your life easier. In all likelyhood, you've got gems all over the place as well. Do you have previous experience with RVM? If not, my suggestion would be to remove RVM, stick with one Rails interpreter (system default, MRI 1.8) and go from there.
Installing rmagick is nearly a rite of passage for Rails developers. It's horrifying at first, but ultimately not that complicated. What the gem really wants to see during native compilation is an install of ImageMagick.
On Linux, I've usually had good luck with whatever package manager is in use. sudo apt-get install imagemagick for example.
If you are on OS X, then it's a bit more work. I've used port several times, and most recently brew to install ImageMagick. If you're on OS X, then head for Google and search for instructions with whatever package management system you happen to be using.

Resources