Pritika
Pritika

Reputation: 306

cannot load such file -- prawn

I have installed the prawn gem, also added it in Gemfile of my project and den install bundles. After installing the bundles I have added this line "Mime::Type.register "application/pdf", :pdf" in my mim-type.rb file. I have added following code in my controller but giving error of "cannot load such file -- prawn". Please guide where I m wrong or missing something? I am new to ruby on rails.Thanks in advance...

   def pdf_test
    require "prawn"
    Prawn::Document.generate("hello.pdf") do
      text "Hello World!"
    end
   end

Upvotes: 1

Views: 1802

Answers (1)

Sasi
Sasi

Reputation: 425

In rails, no need to require gems specified in gemfile. All gems will be automatically required in application.rb.

Upvotes: 1

Related Questions