In your Gemfile
you’ve specified the git version of RMagick. Bundler takes some special steps to add such libraries to Ruby’s load path, but they aren’t available when running without Bundler as they aren’t normal gems. When you run your app without Bunder with ruby app.rb
, Bundler doesn’t get to add this project to the load path, so you get a LoadError.
To fix it, make sure you use Bundler to run your app:
$ bundle exec ruby app.rb
Alternatively you can set up Bundler in your code. Add
require 'bundler/setup'
to the top of app.rb
and Bundler will be setup every time you run.