Topic: Prepare the Kete Application

Topic type:

Outlines the steps to prepare a kete application itself to run in the context of the installation guide.

Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd.

Part of the Installation Guide


Important Note: This step assumes that you are logged in as the user who will be running your Kete. For demos and development this is likely your normal account, for production this is the "kete" account if you have followed the conventions laid forth in the last step.

Prepare Kete

Kete currently is NOT running on the latest version of Ruby on Rails (i.e. Rails 3). For compatibility we must uninstall the version of Rails (and the dependencies the Rails gem comes with) that is distributed with Ruby Enterprise Edition and downgrade to Rails 2.3.5 before we install the gems that Kete needs.

Here are the steps:

Important Note for Mac OS X:  the "sudo su -" command isn't necessary for install using Homebrew, but the rest are. They should be run as normal user and you should ignore "root@host: #" and think "$" prompt for the rest of the "Prepare Kete" section.

First downgrade Rubygems:

$ sudo su - # SKIP FOR Mac OS X
root@host: # gem update --system 1.3.7

Second step is to clear out the conflicting gems (unless you installed Ruby Enterprise Edition with the "--dont-install-useful-gems" option):

root@host: # gem uninstall abstract actionmailer actionpack activemodel activerecord activeresource activesupport arel bundler daemon_controller erubis mail i18n rails railties rack rack-mount rack-test tzinfo treetop thor passenger # uninstall all versions if it asks you

If this uninstall command fails because something wasn't installed, just recompose the command subtracting what isn't listed in "gem list".

Third reinstall Rails, rmagick's gem, and the Kete gems

root@host: # gem install rails --version 2.3.5 
root@host: # gem install passenger
root@host: # gem install mysql # if it doesn't show up with 'gem list mysql'
root@host: # gem install rmagick --version 2.12.2
root@host: # cd /home/kete/apps/your_app # or the correct place for where you installed your_app
root@host: # rake manage_gems:required:install # do "gem install bundler" instead if you are using bundler enabled branch of Kete 1.3

IMPORTANT - NOW GO BACK TO YOUR PLATFORM'S REQUIRED SOFTWARE INSTALLATION AND RUN THE SKIPPED STEPS FOR CONFIGURING PASSENGER FOR APACHE

Warning for users of Kete 1.2: Kete 1.2 is not compatible with the latest Nokogiri gem and causes issues with search results. You can fix this by downgrading to Nokogiri version 1.3.3, which is known to work. The following commands will help to do that.

root@host: # gem install nokogiri --version=1.3.3
root@host: # gem uninstall nokogiri (all versions except 1.3.3)

If you want metadata extracted from uploads, you will also need to run the following (as root):

root@host: # gem install mini_exiftool

Now switch back to your normal user, if necessary, with the "exit" command! Running the rest of the commands in the "Prepare the Kete Application" section as root can cause problems later!

You now need to load the default data into your new Kete before it is ready to run. You need to do this for each database you will be using. If you are just doing this for a demo or development, simply using the default Rails environment of "development" is sufficient. Do this:

$ rake kete:tools:set_locales
$ rake db:bootstrap
...

However, if you are setting up a production site, do this instead:

$ RAILS_ENV=production rake db:bootstrap
...

If you get an error like "No such file or directory - /tmp/mysql.sock", try replacing "localhost" with 127.0.0.1 in your config/database.yml file.



Next step:
Apache2 and Passenger

Discuss This Topic

There are 46 comments in this discussion.

Read and join this discussion

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
Prepare the Kete Application by Walter McGinnis is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License