To run Lita, the following software is required:
- Ruby, version 2.0 or greater (JRuby 22.214.171.124+ or Rubinius 2+ also work)
- Redis, version 2.6 or greater
If you don't already have your own development environment with these dependencies installed, there are two approaches to take to get started with Lita.
Lita Development Environment
The easiest way to get started with Lita is to use the Lita Development Environment, a virtual machine provided specifically for Lita development. The Lita Development Environment has the same steps to set up on any operating system (OS X, Linux, or Windows) and handles the installation of Ruby, Redis, and Lita for you.
To use the Lita Development Environment, follow these steps:
Install Vagrant for your operating system.
Install VirtualBox, the virtualization software Vagrant uses behind the scenes. (If you're already a Vagrant user and you prefer using a VMware provider, you don't need to install VirtualBox. The Lita Development Environment supports both providers.)
Git clone the repository:
git clone https://github.com/litaio/development-environment.git lita-dev
Move into the newly cloned repository:
Start the Vagrant VM:
This will take a few minutes the first time you do it. You'll want to be on a fast, stable Internet connection.
SSH into the VM:
Once connected to the VM through SSH, start the Lita Development Environment:
At this point, you will find yourself in a shell in a Debian system with Lita already installed.
To create a new Lita project, run:
lita new .
This will generate a Gemfile and a lita_config.rb file, which you will eventually edit to configure Lita.
Ensure all dependencies are installed by running
For a full list of commands Lita supports, run:
You must interact with the
bundle commands inside the Lita Development Environment, but you can edit your project files either inside the VM or on your host system with the editor of your choice — the directory you're in inside the Lita Development Environment is shared with the "workspace" directory in the Git repository you cloned on your host system.
When you're done, run exit to leave the Lita Development Environment, then run exit again to disconnect from the Vagrant VM.
Methods for installing Ruby 2.0 vary a lot between systems and are largely beyond the scope of this documentation. However, here are some quick tips for various operating systems:
Lita works with all the major implementations of Ruby: MRI, JRuby, and Rubinius. The minimum required version of JRuby is 126.96.36.199. The minimum required version of Rubinius is 2.2. Because JRuby does not support fork/exec, Lita's built-in process daemonization will not work, but this feature is going to be removed in the next version of Lita and should not be relied on anyway.
Ruby is available via many Linux distribution's package managers. The distribution may only package an older (1.x) version of Ruby, in which case you will need to compile it yourself. For Ubuntu, check out Brightbox's Ubuntu Ruby packages.
Mac OS X
Mac OS X 10.9 Mavericks or higher comes with Ruby 2.0 already installed, although the some commands may require you to use sudo for the correct permissions. Another good choice is installing a Ruby package with Homebrew.
Compiling from source on a Unix-like system
ruby-build automates the compilation process for you.
RubyInstaller is a good choice.
Redis installation is generally easier. Packages are available for most Unix-like systems. Compiling from source is also very straightforward. See the documentation on the Redis website for details.
Given that you have working installations of the dependent software (Ruby and Redis), installing Lita is as simple as running the following command in your shell:
gem install lita
Once Lita is installed, create a new Lita project with this shell command:
This will generate a new directory called "lita" with a Gemfile and Lita configuration file, which is all you need to configure and run Lita.
For a full list of possible invocations of the
lita command, run:
If you run into any errors that result in
Bundler::GemNotFound, you can always let bundler install any dependencies for you: