how to install docsplit

http://docs.webfaction.com/software/rails.html#installing-gems

 

To install a Ruby Gem in your Rails application:

  1. Open an SSH session to your account.

  2. Enter cd $HOME/webapps/app, where app is the name of your Ruby on Rails application, and press Enter.

  3. Enter export GEM_HOME=$PWD/gems and press Enter.

  4. Enter export RUBYLIB=$PWD/lib and press Enter.

  5. Enter export PATH=$PWD/bin:$PATH and press Enter.

  6. Enter gem install docsplit, where gem_name is the name of the Ruby Gem you want to install, and press Enter.

--------------------------------------------------------------------------------------------------------------------------------

To resolve the docsplit issue, run the following commands in a SSH session:

echo "export PATH=/home/kyholdings/.gem/ruby/1.8/bin:$PATH" >> ~/.bashrc
source ~/.bashrc

You only need to run the "export PATH=....." command once. It looks like you had run it several times, which was giving you a broken PATH in your .bashrc.
each PDF or OFFICE DOCUMENT PAGE SHOW:
Since you do not have docsplit installed on this system, we can not render the pages of this document.
Your bashrc also contained the line "source ~/.bashrc", which was not correct.

I've fixed both of those issues and restarted your Zope, and your site seems to display PDFs correctly now.



GraphicsMagic can be built from source in your home directory by following the generic build documentation at http://docs.webfaction.com/software/home-install.html

ghostscript, Poppler, OpenOffice, and md5 are already installed. 

---------------------------------------------------------------------------------------------------------------------------------

http://documentcloud.github.com/docsplit/

fix the problem of the Install LibreOffice

Actually docsplit passes that parameter to the java interpreter, but it is configured incorrectly. Here is how you can correct it:

- log in via SSH to your account
- edit the

/home/kyholdings/.gem/ruby/1.8/gems/docsplit-0.6.4/lib/docsplit.rb

- locate the following line:

office ||= "/usr/lib/openoffice" if File.exists? '/usr/lib/openoffice'

and replace it with:

office ||= "/usr/lib/openoffice.org3" if File.exists? '/usr/lib/openoffice.org3'

and you will be set.

------------------------------------------------------------------------------------------------------------------------------------------------------------------

set OFFICE_PATH environment variable to let docsplit know where have installed it:

[ryans@web335 ~]$ ls /usr/lib64/libreoffice/program/soffice
/usr/lib64/libreoffice/program/soffice

OFFICE_PATH=/usr/lib64/libreoffice is right.

So vi  ~/.bashrc

add:  

export OFFICE_PATH=/usr/lib64/libreoffice                        


Then Edit the file: /home/kyholdings/.gem/ruby/1.8/gems/docsplit-0.6.4/lib/docsplit.rb
revised as follow:
office ||= "/usr/lib64/openoffice.org3" if File.exists? '/usr/lib64/openoffice.org3'
office ||= "/usr/lib64/libreoffice" if File.exists? '/usr/lib64/libreoffice'

--------------------------------------------------------------------------------------------------------------------------------------------------

Upgrading Ghostscript from 8.7 to latest vision 9.07 to fix the convert error as follow:

> /home/kyholdings/.gem/ruby/1.8/bin/docsplit images
> /tmp/tmpUtYiOp/dump.pdf --size 1000x,700x,180x --format gif --rolling
> --output /tmp/tmpUtYiOp
> finished with return code 1
> Error: /stackunderflow in --run--
> Current allocation mode is local
> GPL Ghostscript 8.70: Unrecoverable error, exit code 1
> gm convert: Postscript delegate failed (/tmp/tmpUtYiOp/dump.pdf).

You received this same error in ticket BMO-108778 on 09 Dec 2012, which you solved by upgrading Ghostscript


How can I setting to let app know docsprit installed already ?



You have docsplit installed in /home/kyholdings/.gem/ruby/1.8/bin/, so my guess is that your application doesn't have that location on its search path (the PATH environment variable).

I've added a symlink to ~/.gem/ruby/1.8/bin/docsplit into your ~/bin directory

ln -s /home/kyholdings/.gem/ruby/1.8/bin/docsplit ~/bin/

 

How to symlink a file in linux

 

ln -s target linkName

 

 

 

You can have a look at the man page here:

 

http://linux.die.net/man/1/ln

 

 

 

 

 

Installing Software from Source


mkdir -p $HOME/tmp

export TMPDIR=$HOME/tmp

wget http://downloads.ghostscript.com/public/ghostscript-9.07.tar.gz

tar -xf ghostscript-9.07.tar.gz

cd ghostscript-9.07

./configure --prefix=$HOME

make

make install