Skip to content

ASI Installation Guide (rails 3)

Kusti edited this page Nov 3, 2011 · 10 revisions

ASI installation guide

Here are the instructions to put your own installation of ASI server to a computer where you have access. During the development, we have not yet had many people hosting ASI outside the core team, so the instructions may be less thorough than preferred. However, please send us your questions if you get stuck and we'll try to help you (and enhance the instructions on the way). Also, if you yourself find out something that is missing from the instructions or would make the documentation better, please use the edit button of this wiki page and make the additions immediately. All questions and helpful additions are appreciated.

The following instructions were created using ruby-1.8.7-p330 on OS X 10.7.1.

ASI code

First of all you need to clone ASI code from github

git clone git://github.com/sizzlelab/asi.git

Getting required gems

You will need to install bundler manually:

gem install bundler

Now you can install all required gems via bundler:

bundle install

rmagick gem installation will fail if you do not have Imagemagick suite installed on your machine. Try installing Imagemagick and re-run bundle install if that happens. Also, on some systems you may need to install libmagick-dev package and the libmagick++-dev package (ubuntu), and even after that if you get an error stating that you have an incomplete ImageMagick package the best thing to do is to remove it and install from source.

Install Sphinx

After installing all the required gems you need to install Sphinx from source unless you already have it installed. See "Sphinx installation instructions.":http://freelancing-god.github.com/ts/en/installing_sphinx.html (use Sphinx 0.9.9).

Make sure indexer is in your path.

Configuration

You need to edit ASI's configuration to match your system:

  1. edit details in the install.sql
    • (you will have to at least replace all instances of "password_here" with the some real password)
  2. cp config/database.example.yml config/database.yml
  3. edit details according to your database and (what you put in install.sql) to database.yml
  4. cp config/config.example.yml config/config.yml
  5. edit details according to your system configuration to config.yml

You need to prepare the database by running install.sql against it, with a mysql user preferably (you have to create this separately). After that you are ready to run:

rake RAILS_ENV=production db:migrate

Please note that this only prepares the database for production environment. Should you want to prepare the development environment's database you need to run rake db:migrate in development mode:

rake RAILS_ENV=development db:migrate

On Ubuntu you may at this point get an error stating `gem_original_require’: no such file to load — net/https. To fix this you need to install libopenssl-ruby.

In some cases you might also remove the comment from the line "socket: /var/run/mysqld/mysqld.sock" in database.yml. It used to be uncommented by default but it seems that in most cases it is not needed and instead prevents the MySQL connection.

Also, before starting ASI for the first time you should rebuild the thinking_sphinx indices and start the searchd daemon, as otherwise some of the API calls will run slow and you will get error messages regarding missing something.sphinx.conf file. To see all thinking_sphinx related options run:

rake -D thinking_sphinx

To rebuild the index and start daemon run:

rake thinking_sphinx:rebuild

Please note that you may have to create a startup script to start searchd automatically as your system boots up.

If you are running Kassi on top of ASI, you need to add Kassi as an accepted client to the clients table. Do this from the rails console: Client.create(:name => "kassi", :realname => "Kassi", :show_email => true, :password => "PASSWORD_HERE"). Remember to add the same name and password in the Kassi config file as asi_app_name and asi_app_password.