I don't follow at all what you are trying to do and why.
Once you run irb from your local installation instead of running
'script/console' from within your rails root directory, you are pretty
much not running rails at all but just basic ruby and at that point, you
are not on topic here.
Then you've seeming installed the iText jar files in your rails
application which should have been installed as gems and automatically
loaded from the appropriate ruby/gems path.
The error you are asking about is from rjb which likewise, has nothing
to do with rails.
My own experience with pdf-stamper was with rails 1.2.x and though it's
a gem and should be functional with current versions of rails I'm a
little hesitant to recommend it because I simply don't know and that is
why I tried to steer you onto a methodology that didn't require
java/rjb, especially since I gathered that your experience with ruby and
with rails are somewhat limited.
> Thank you so much for your help!
>
> I am finally able to install pdftk. I have a question about how to send
> pdf to browser directly.
>
> my code is here:
>
> pdf_output = `pdftk #{filename} fill_form #{fdf.path} output`
> respond_to do |format|
> format.pdf do
> send_data pdf_output, :filename => filename,
> :type => "application/pdf"
> end
> end
>
> But the browser can not open the pdf. It says it is empty.
>
> What is the correct way to do this?
----
I've always used send_file myself, send_data might work but I have no
experience with it but I think you're being sloppy with your command...