** THIS IS STILL A WORK IN PROGRESS **
Installation instructions for installing Blacklight
Install the following pakages
$ sudo apt-get update
$ sudo apt-get install openssh-server #so you can ssh to your machine
$ sudo apt-get install links2 #a command line browser handy for testing
$ sudo apt-get install build-essential
$ sudo apt-get install git-core
$ sudo apt-get install curl
$ sudo apt-get install mysql-server
--- set a root password for mysql
$ sudo apt-get install sqlite3
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install libxml2 libxml2-dev
$ sudo apt-get install libxslt1-dev
$ sudo apt-get install libcurl3-dev
$ sudo apt-get install libreadline5 libreadline5-dev
$ sudo apt-get install libncurses5 libncurses5-dev
Install Java
$ sudo apt-get install sun-java6-jdk
If you see the error “Package sun-java6-jdk has no installation candidate” then you need to add a new source to the list of repositories.
Edit the file /etc/apt/sources.list and add the line “deb http://archive.canonical.com/ lucid partner”
$ sudo vim /etc/apt/sources.list
Search a line with “#deb http://archive.canonical.com/ lucid partner” uncomment it or add the line “deb http://archive.canonical.com/ lucid partner”
Update the package index, as we have just added a new source and install java again. It should work this time.
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Accept the two license agreements
Install rvm
I followed instructions from http://rvm.beginrescueend.com/rvm/install/.
I have written the basics of what I did here.
$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
$ vim .bashrc
Comment the line [ -z “$PS1” ] && return and add the if statement as below
#[ -z "$PS1" ] && return
if [[ -n "$PS1" ]]; then
[ -z "$PS1" ] && return
# Some code here... e.g.
export HISTCONTROL=ignoreboth
fi
Add the following line in the end of the file. IT HAS TO BE THE LAST LINE
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
$ vim .profile
Add the following line in the end of the file. IT HAS TO BE THE LAST LINE
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
Test rvm – To test rvm, open a new shell or logout and login again.
$ type rvm | head -n1
Should get rvm is a function
NOTE: DO NOT USE SUDO WITH RVM
Install ruby using rvm.
Before that I need to install a few packages for running ruby on Ubuntu
$ rvm package install readline
$ rvm package install iconv
$ rvm package install curl
$ rvm package install openssl
$ rvm install 1.8.7 -C "--with-openssl-dir=$HOME/.rvm/usr --with-readline-dir=$HOME/.rvm/usr --with-iconv-dir=$HOME/.rvm/usr --with-curl-dir=$HOME/.rvm/usr" --reconfigure –force
The below where rubygems was taken from:
$ rvm install 1.8.7
$ rvm use 1.8.7 --default
$ rvm gemset create rails_2_3_5
When you run “gem list”, you should see nothing!
$ gem install rails -v=2.3.5
$ rvm use 1.8.7@rails_2_3_5 --default
Install rubygems
$ rvm use 1.8.7
$ rvm gemdir
Should list the gemdir placed within the .rvm dir in the local users home folder
~/.rvm/gems/ruby-1.8.7-p302 (In my case it is /home/ingestadmin/.rvm/gems/ruby-1.8.7-p302)
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.5.2.tgz
$ tar -zxvf rubygems-1.5.2.tgz
$ cd rubygems-1.5.2/
$ ruby setup.rb
$ cd ~
$ gem update --system
Install libssl-dev
$ sudo apt-get install libssl-dev
# Not sure if the following is needed
$ cd .rvm/src/ruby-1.8.7-p302/ext/openssl/
$ ruby extconf.rb
$ make
$ make install
Install bundler
$ gem install bundler
Then continue the installation from the Blacklight project, but don’t use sudo, so…
$ gem -v
$ gem install rubygems-update
$ update_rubygems
$ gem sources -l
It should show:
http://gems.rubyforge.org
http://gems.rubyonrails.org
http://gems.github.com
http://gemcutter.org
If doesn’t, add them like this:
gem sources -a http://gems.rubyforge.org
gem sources -a http://gems.rubyonrails.org
gem sources -a http://gems.github.com
gem sources -a http://gemcutter.org
$ gem install sqlite3-ruby
$ gem install mysql
If there is a problem with the gems
(following instructions from
http://excid3.com/blog/2011/02/undefined-local-variable-or-method-version_requirements-for-nameerror/)
do this:
$ gem install rubygems-update -v='1.4.2'
$ gem uninstall rubygems-update -v='1.5.2'
$ update_rubygems
if complains about missing gems, use then:
$ rake gems:install
“If you get the error ‘could not find table “searches”‘ it’s b/c you need to run
$ rake db:migrate