Version 90, last updated by Vitalie Danu at September 20, 2011 12:34 UTC

Install application stack

Install a database server

Debian/Ubuntu:

  • apt-get install mysql-server-5.1 libmysqlclient15-dev

Other Linux:

Install Ruby, Rubygems, and Rails

To familiarize yourself with this application stack, refer to Learning Ruby, Starting with Ruby and Rubygems and Ruby on Rails . Our current versions are:

  • Ruby 1.8.7
  • Rubygems
  • Rails 3.0.10

Debian/Ubuntu:

  • Ruby: apt-get install ruby ruby1.8-dev irb rdoc rake
  • Rubygems:apt-get install rubygems OR
    • Download from here
    • Unpack and install:
      tar xvf rubygems-1.3.7.tgz
      cd rubygems-1.3.7
      ruby setup.rb
      ln -s /usr/bin/gem1.8 /usr/bin/gem
    • Confirm your version: gem --version.
  • Rails: gem install rails --version 3.0.10

Other Linux:

  • Ruby: See the Ruby site and/or use your package manager to find a ruby package.
  • Rubygems: Use your package manager to find a rubygems package. Confirm your version by doing gem --version. If not the proper version, instead follow the installation instructions.
  • Rails: gem install rails --version 3.0.10

Windows:

Mac OS X Leopard:

  • Install MacPorts
  • Install Xcode 3.0+ and X11. You can find this as optional installs in Leopard install DVD.
  • Follow this guide to install Ruby, Rubygems and Rails with MacPorts

Mac OS X Snow Leopard:

  • Install XCode or only GCC (http://github.com/kennethreitz/osx-gcc-installer)
  • Install Homebrew (http://mxcl.github.com/homebrew/)
  • Install mysql: brew install mysql and follow instructions
  • Install rvm: bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
  • Install ruby1.8.7 and rubygems: rvm install 1.8.7 --default

Patch Rails (if you do not have Rails 2.3.5)

To send outbound email, you need to apply a patch to Rails 2.3.3.  (actionmailer-2.3.5 already have enable_starttls_auto flag).

  • Download enable_starttls_auto.diff
  • Determine where Rails ActionMailer is installed:
    actionmailer_dir=`gem env gemdir`/gems/actionmailer-2.2.3
  • Apply the patch:
    patch -d $actionmailer_dir -p2 -i <patch-file>

Install ImageMagick

The ImageMagick library is used to generate thumbnails and captcha images. It depends on a number of optional delegate libraries to extend its functionality, which are used for rendering specific formats.

    1. First, install delegate libraries

      Instructions for installing delegate libraries are listed here and here. As a minimum, you need to install the following delegate libraries:

      • PNG (needed by the breakout test suite)
      • If you plan to render images/thumbnails in other formats, install the appropriate delegate libraries for those formats.
    2. Then, install ImageMagick itself
  • For Debian/Ubuntu:
    aptitude install imagemagick libmagick9-dev
  • For CentOS/Fedora/RedHat:
    # First add epel repository, http://fedoraproject.org/wiki/EPEL/FAQ
    yum install ImageMagick
  • For other Linux, follow these instructions.
  • For Mac OS X Snow Leopard:
  • brew instal gs
    brew install imagemagick
    brew install libmagic
    brew link libmagic
    
  • Also For Mac OS X, you can follow these instructions.
  • For Windows (install RMagick binary gem):
  • Could not open library 'magic1.dll': The specified module could not be found.
    . Could not open library 'libmagic.1.dylib': The specified module could not be f
    ound.
    . Could not open library 'libmagic.so.1.dll': The specified module could not be
    found.
    . Could not open library 'libmagic.1.dylib.dll': The specified module could not
    be found.
    . Could not open library 'libmagic.so.1': The specified module could not be foun
    d.
    C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile
  • After installing, issue the below command to confirm that ImageMagick properly incorporated the delegate libraries you installed (if not, see this link):
  • convert -list configure | grep DELEGATES

    Install Rubygem Libraries

    From release 3.9 we are using bundler

    gem install bundler

    If you are using Ubuntu, you will need to install these libraries

    sudo apt-get install libsqlite3-dev libxml2 libxslt

    so from project dir run

     bundle install

    it will install all needed gems

    Install GEM mysql (DEPRECATED)

    Linux

    • gem install mysql

    Mac OS X Leopard

    sudo gem install mysql -- --with-mysql-config=`which mysql_config5`

    Note: here is another command that has worked on Mac OS X Leopard:

    sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql

    Mac OS X Snow Leopard

    sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

    Windows

    • gem install mysql (If you see warning message about missing definitions, just ignore them (the source is sqlite3-ruby or mysql, but this does not matter)
    • find the file "libmysql.dll" in your "mysql/bin" folder (usually "C:\MySQL\bin")
    • copy & paste this file to "ruby/bin" (usually "C:\Ruby\bin")
    • download the following "libmysql.dll" and save it in "ruby/bin" in case that the error "Mysql::Error: query: not connected: CREATE TABLE `schema_migrations`" occurs: http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
    • test that MySQL gem works properly: ruby -e "require 'rubygems'; require 'mysql'"

    If you use RVM

    Xapian and SVN ruby bindings.

    If you are using RVM to host your breakout installation you should copy xapian and svn ruby bingins in a ruby home directory that rvm creates. On Debian/Ubuntu you could do this with the next steps:

    $ rvm use 1.8.7 # Or other ruby or patchset you use

    Find the ruby home where it is installed with:

    $ rvm info | grep MY_RUBY_HOME
    MY_RUBY_HOME: "/home/max/.rvm/rubies/ruby-1.8.7-p334" # -> Current home for ruby, you can have a different path.

    You should have libxapian-ruby1.8 installed on your system. By listing its contents (dpkg -L libxapian-ruby1.8) you can find the bindings, an .rb file, and a .so file.

    ...
    /usr/lib/ruby/1.8/xapian.rb
    /usr/lib/ruby/1.8/i486-linux/_xapian.so 
    ... 

    Those two files should be copied in your ruby directory. They should look like the following (paths will be different on your evnironement):

    /home/max/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-linux/_xapian.so
    /home/max/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/xapian.rb

    You can follow these steps to copy SVN ruby bindings into your ruby home also.

    libreadline issue

    If you got an error message regarding libreadline, missing package, checkout this url https://rvm.beginrescueend.com/packages/readline/

     

    Install memcached

    Debian/Ubuntu:

    • apt-get install memcached

    Mac OS X Snow Leopard:

    • brew install memcached

    Optional Components

    You can run the development environment without some components - Event processing, code browser and repository tools, text indexing and search, and inbound emails.  Here are instructions for installing these optional components:

    Event queue - Stream alerts and event processing

    For event processing, see these instructions.

    Code browsing

    Code browsing requires multiple additional application components: the code browser, our tool control process, and repository software. Breakout repositories are managed by external repository software, and breakout interfaces with this software via the tool control process. The tool control process and repository software can optionally be hosted on your development host along with the rest of the breakout application. You only need to install these components if you will be making changes to the code browser or to external tools; simple changes (such as bookmark sharing) will not need these components.

    For text indexing, see these instructions

    Email gateway

    For inbound emails, see these instructions.

    Other Information