" No such file to load -- prawn' #399

Closed
xb29 opened this Issue Sep 7, 2012 · 2 comments

2 participants

@xb29

Hi,

I am currently working with Ruby v1.9.2p290 and Rails 3.2.8.
I installed prawn with 'gem install prawn', dans I can see now in my gems list. It is called 'prawn (0.12.0)'.

In this way, I restart my Rails application, and I tried to use prawn with this example :
require 'prawn'

Prawn::Document.generate("test.pdf") do
text "test "
end

However, it failed and the following error was raised :
Completed 500 Internal Server Error in 29ms
LoadError (no such file to load -- prawn):
app/controllers/devisdatelms_controller.rb:28:in `index'

Does someone have an idea about the cause of this problem ? My Google searches don't bring me some convincing results...

Thanks

@bradediger
prawnpdf member

If you're using Rails 3, you should put prawn in your Gemfile (and bundle install) rather than just installing it directly. Bundler isolates your gems, so you won't be able to use it from your Rails application if it's not part of your Gemfile.

@bradediger bradediger closed this Sep 7, 2012
@xb29

Understood. Thank you for the quick answer, it works perfectly now !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment