My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 09, 2009 by ewlarson
Labels: Featured
Installation  
Installation Instructions for BibApp

Table of Contents:

Introduction

BibApp is a Ruby on Rails 2.3 web application. If you are familiar with installing Ruby on Rails applications, BibApp should be no different! If this is your first time with Ruby on Rails, don't worry...we've tried to make things easy on you.

At a basic level, Ruby on Rails applications require the following:

  • A Web server
  • A Database
  • Ruby and..
  • Rails

Currently, because of a small development/testing team, we have some recommendations for your Rails setup for BibApp. You may be able to get away with other non-recommended Ruby on Rails setups. But, we haven't verified they all work with BibApp, yet.

So, without further ado...

Software Pre-requisities

BibApp should run on any Operating System. Currently we've had it successfully running on Linux, Mac OS X and Windows XP.

BibApp requires the following software to function properly:

  • Ruby 1.8.7
    • Check your version by running ruby --version at command line
    • Ruby Enterprise Edition 1.8.7-20090928 is highly suggested.
  • RubyGems 1.2.0 or later
    • Check your version by running gem --version at command line
    • RubyGems 1.3.5 is the latest.
    • If you have an older version of RubyGems, you should be able to update it like this:
    •       gem update --system
  • Java 1.5 or later (note: Java 1.5 is also sometimes called Java 5.x, similarly Java 1.6 is also called 6.x)
    • Check your version by running java -version at command line

BibApp gives you a few options when it comes to your database. Currently, we support either of the following:

OR

Optional: If you want to be able to pull down BibApp directly from our GoogleCode site, you may also wish to install Subversion (svn).

That's everything you need to get started...

Additional Pre-requisites for Ubuntu / Debian (not Mac OSX)

Before trying an installation on Ubuntu or Debian-based operating systems, there are a couple of libraries you'll want to make sure you have installed:

In addition, if you are planning to install BibApp on MySQL, you will need to MySQL development package. This is unnecessary if you will be using PostgreSQL.

You should be able to install these packages quickly via apt-get. For example:

  sudo apt-get install libxml2 libxml2-dev ruby1.8-dev

Additional Pre-requisites for Mac OSX

You'll need to install Apple's XCode tools.

Header files are not delivered by default with Mac OS X, you need to install the Xcode Tools package after installing OSX. You can find it in the Optional Installs / Xcode Tools directory on the Leopard DVD.

If you want to launch BibApp using Apache & Phusion Passenger, you will need to start up Mac OSX's built in Apache Web Server.

Go to your 'System Preferences' > 'Sharing' > 'Services' and enable 'Personal Web Sharing'. This will start up Apache for you, and you should be able to access it by visiting http://localhost/ in your web browser.

Stack Installation

Ubuntu Linux

Installation instructions for Ubuntu (Illinois) - InstallationUbuntuLinux.

Solaris

Installation instructions for Solaris (Wisconsin) - InstallationSolaris.

Get Started

Before we jump in, it's worth explaining a bit about what software BibApp has bundled (Rails uses the term "frozen") within it. You don't need to understand what everything is doing, but we just want to let you know it's there! When you download BibApp, it already comes pre-packaged with the following:

  • Rails 2.3 - That's right, you don't even have to install Rails!
  • Solr - Used for all the BibApp browse/search interfaces
  • A variety of Ruby Gems and Rails Plugins. It's worth highlighting a few custom plugins created specifically for BibApp:
    • citation_parser and citation_importer - These custom plugins parse citations from our various supported input formats, and import the data into our database structure. As more citation parsers are created, we'll be able to support more input formats!
    • sword_client - This is our custom SWORD (Simple Web-service Offering Repository Deposit) client. It lets you deposit research (both metadata and files) into your local repository directly from BibApp!

Download Code

There are two different ways to install BibApp:

  1. If you have Subversion installed, you can just pull down the latest code (the below example checks it out to your ~/bibapp/ directory):
  2.     svn checkout http://bibapp.googlecode.com/svn/trunk/ ~/bibapp/
  3. Otherwise, you can download the latest Zipped up release from the Downloads
Note #1: We currently recommend installing BibApp from our Subversion "trunk". That version is not only more stable than the old 0.7 release, but it also should be easier to install.
Note #2: Throughout the remainder of these instructions we use the placeholder [bibapp] to represent the location where you have downloaded the BibApp code!

Configure BibApp

Next, you'll need to edit the configurations for your local settings. In the [bibapp]/config directory, look for the following "example" configurations:

You'll need to copy each of these files into a file without the .example extension and personalize the contents as necessary. Each of the above files include instructions within them describing how to configure them properly for your institution. In the end you should end up with a file list similar to the following (REQUIRED configuration files are bold):

Ruby Gem Installations

Unfortunately, we cannot bundle everything within BibApp. We've tried to minimize your need to install Gems, but there are still a few you'll need to install yourself:

  1. First, make sure you have rake installed:
  2.      gem list rake
  3. Auto-install all our gem prerequisites, via this rake command:
  4.      rake gems:install
  5. Database Driver Gem - based on your database of choice
  6. Ruby Web Server - Mongrel is recommended. We also recommend mongrel_cluster, which allows you to run several mongrel instances in a cluster (though, if you are just trying out BibApp, this isn't really necessary).
  7.      gem install mongrel 
         gem install mongrel_cluster 
    We are now recommending the Apache2 web server with Phusion Passenger (aka mod_rails). See the wiki page Mongrel2PassengerMigration for instructions.

Common Warnings / Errors

Error / Warning Message Resolution
Log File Warning:

Rails Error: Unable to access log file. Please ensure that /bibapp/log/development.log exists and is chmod 0666.
Make sure to change the permissions on this log file, so that it is both readable and writeable to everyone. For example: chmod 0666 development.log
Permissions Error:

ERROR: While executing gem ... (Gem::FilePermissionError)
For Ubuntu/Debian or Mac OS X: This means you need to run the command as a super user. So, try adding sudo before the command: (e.g.) sudo rake gems:install
Error building libxml-ruby gem:

ERROR: Failed to build gem native extension
For Ubuntu/Debian: You should be able to resolve this error by installing libxml2 and libxml2-dev: (e.g.) sudo apt-get install libxml2 libxml2-dev
Loading error:

'require': no such file to load -- mkmf (LoadError)
For Ubuntu/Debian: You should be able to resolve this error by installing the latest Ruby development package (ruby1.8-dev): (e.g.) sudo apt-get install ruby1.8-dev

Setup Your Database

Now, you'll need to setup a database for BibApp. You should already have installed either MySQL or PostgreSQL. So, it's just a matter of creating a new database!

Make sure your database is named the same as the 'database' setting in your config/database.yml file! In addition, you should login as the user specified in your config/database.yml when creating your database (to ensure that user owns the database)

For this example, we're just setting up a BibApp Development database. But, you can use the same concept to also setup a Test and Production database, when you are ready.

Obviously, remember to change PASSWORDHERE to the password you want set for your 'bibapp' database user.

Now you can generate the BibApp database structure into your new database! From within your [bibapp] directory:

    rake db:schema:load

You should see a large number of 'create table' messages scroll by. That's perfectly normal! But, if any errors appear, there are problems which you will have to resolve before BibApp will function properly!

Before continuing, you also need to initialize your database with an Administrator account and the current SHERPA RoMEO publisher policy data. This data is used to help researchers determine which of their publications can be deposited in a local repository for safe keeping. From within your [bibapp] directory:

    rake db:seed

Your database should now be setup and initialized properly!

Startup BibApp

You're almost there!

In order to startup BibApp on your server, you must do both of the following (from within your [bibapp] directory):

Try it out! Assuming your web server is on port 3000 (which is Mongrel's default), you should have BibApp running at: http://localhost:3000/

Updating BibApp (Bill - 2009.04.27 - Beta!)

Steps for updating BibApp with the latest from Subversion. Run all commands as root (sudo).

  1. (Recommended) Make a full back up of the bibapp/ directory
  2.     cp -R bibapp/ bibapp.bak/
  3. (Recommended) Back up the database
  4. Stop mongrel
  5. Update the source code
  6.     cd bibapp/ 
        svn update
        svn status
  7. Rebuild the database (only necessary when there are new migration scripts)
  8.     rake db:migrate
  9. Check/Edit any updated config/ files


  10. Restart/Refresh solr (refresh only necessary when solr configs are updated in vendor/bibapp-solr)
  11.     rake solr:stop
        rake solr:start
        rake solr:refresh_index
  12. Install any new gems (only necessary when environment.rb is changed)
  13.     rake gems:install
  14. Start Mongrel

Using BibApp

Login For the First Time

BibApp comes with a pre-initialized "admin" user. The login for this user is "admin" (lowercase), and the default password is "bibapp" (lowercase).

This "admin" user has System Administrator rights, and can do anything within BibApp. Therefore, it is absolutely necessary to login and change the password for this user as soon as possible.

Repeat: it is absolutely necessary to login and change the password for this user as soon as possible.

So, login and do it now!

  1. After logging in, click on "Welcome: admin" in the upper right, to view your "admin" user's account information.
  2. Click "Change Password", and fill out the default password along with your new password

Finally, (although not required at this time) you may wish to change the email account associated with this "admin" user. At this time, BibApp only uses that email address if you have forgotten your password and request a new one be generated. So, if you have any concerns about forgetting your "admin" user's password, change the email to point to a valid email address!

Problems / Questions / More Information

We're definitely aware that these instructions are a bit lacking. We're working on updates before our BibApp 1.0 release. If you run into any interesting problems or "gotchas" during the installation or setup, let us know!

The easiest (and preferred) way to contact us is via our BibApp Google Group.

If you ran into problems during the installation, try and send us the following:

  • Ruby version (run ruby --version)
  • Gem version (run gem --version)
  • Operating system
  • Task/step you were performing
  • Error message text



Sign in to add a comment
Hosted by Google Code