# PDFs prawn gem freeze into the app

**URL:** <https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622>\
**Category:** Rails\
**Created:** [March 23, 2009, 10:01am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622 "2009-03-23T10:01:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 23, 2009, 10:01am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/1 "2009-03-23T10:01:06Z")

</div>

I was having great success with creating PDFs with prawn, I followed  
Ryan B. latest screencast. All good.

Trouble is when i come to deploy the app on my webhost I ran into  
trouble.

Rails 2.3 app.  
I did, “sudo rake gem unpack prawn” to freeze it in.

I put the app on my webhost but it won’t start, some error saying it  
can’t find prawn.

Any ideas? (summary: works locally not on my webhost)

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 23, 2009, 10:50am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/2 "2009-03-23T10:50:02Z")

</div>

On 23 Mar., 10:01, bingo bob [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> can’t find prawn.
> 
> Any ideas? (summary: works locally not on my webhost)

On your local machine:

´rake gems:unpack GEM=prawn´

Then deploy afterwards.

–  
Best regards,  
David K.  
[http://twitter.com/rubyguy](http://twitter.com/rubyguy)

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 23, 2009, 12:24pm UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/3 "2009-03-23T12:24:48Z")

</div>

ok, thanks, I’ll try that a bit later and report back.

bb

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 24, 2009, 8:14am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/4 "2009-03-24T08:14:37Z")

</div>

bingo bob wrote:

> ok, thanks, I’ll try that a bit later and report back.
> 
> bb

OK I did that command but no luck…Command completed find but nothing  
changed (git status showed me nothing to commit after the command)…

Here’s the ls from the root of the app

README app db lib prawn-0.4.1 script tmp  
Rakefile config doc log public test vendor

as you can see prawn is there.

Do I need something else, as I say this works fine on my Mac but not on  
the deplyed app on my webhost…

Errors in mongrel.log in production when trying to start the app are as  
follows…

\*\* Starting Rails with production environment…  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem\_original\_require’: no such file to load – prawn  
(MissingSourceFile)

bla bla

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 24, 2009, 10:24am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/5 "2009-03-24T10:24:37Z")

</div>

Thanks, rubyguy helped me out with this…

Turns out that I needed to have prawn-0.4.1 in the vendor/gem directory.

For some reason the rake command I ran dropped it in root.  
vendor/gem/prawn-0.4.1 was not created.

I’ve fixed by making… vendor/gem/ and git mv’ing the directory  
prawn-0.4.1 to it.

Works now (although I do get a strange error about the gem config file  
for prawn being out of date - it offers a solution which doesn’t work  
either)…

Need to get the hang of these commands, thanks rubyguy!

bb

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [March 25, 2009, 3:22am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/6 "2009-03-25T03:22:09Z")

</div>

On Mar 23, 5:01 am, bingo bob [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I was having great success with creating PDFs with prawn, I followed  
> Ryan B. latest screencast. All good.
> 
> Trouble is when i come to deploy the app on my webhost I ran into  
> trouble.
> 
> Rails 2.3 app.  
> I did, “sudo rake gem unpack prawn” to freeze it in.

That shouldn’t have worked - the task to unpack gems is rake  
gems:unpack. The command you typed just errors out; omitting the  
‘rake’ part would get the results you describe.

To get rid of the warning, run ‘rake gems:refresh\_specs’ on your local  
machine (where Prawn is installed). If that still give you the warning  
about ‘no specification file’, let me know.

–Matt J.

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [May 7, 2009, 6:31am UTC](https://www.ruby-forum.com/t/pdfs-prawn-gem-freeze-into-the-app/163622/7 "2009-05-07T06:31:22Z")

</div>

I am seeing this exact issue.

config.gem: Unpacked gem prawn-0.4.1 in vendor/gems has no specification  
file. Run ‘rake gems:refresh\_specs’ to fix this.

rails 2.3.2  
ruby 1.8.6 (2008-03-03 patchlevel 114)  
there appears to be no .specification file  
in vendor/gems/prawn-0.4.1  
nor in its system gem directory

rake gems:refresh\_specs has no effect

Matt J. wrote:

> > trouble.  
> > machine (where Prawn is installed). If that still give you the warning  
> > about ‘no specification file’, let me know.
> 
> –Matt J.
> 
> >

–  
View this message in context:  
[http://www.nabble.com/PDFs-prawn-gem-freeze-into-the-app](http://www.nabble.com/PDFs-prawn-gem-freeze-into-the-app)…-tp22656370p23420025.html  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
