prawnpdf / prawn

Fast, Nimble PDF Writer for Ruby
https://prawnpdf.org
Other
4.65k stars 687 forks source link

Fix Rakefile so running rake without bundling gives a better error #1296

Closed technicalpickles closed 10 months ago

technicalpickles commented 1 year ago

I was trying to make some changes locally, and followed the README's direction to run rake to test. It failed though:

❯ rake
rake aborted!
LoadError: cannot load such file -- prawn/dev/tasks
/Users/josh.nichols/workspace/prawn/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

The fix is bundle install, but it would be nice to be directed to do that. This change uses bundler/setup to try to load bundled dependencies, and if something isn't met for some reason, it fails with a more instructive message:

❯ rake
Could not find prawn-dev-0.3.0 in locally installed gems
Run `bundle install` to install missing gems.