Very short description of the application.
Application is written in ruby language, using Ruby on Rails web framework.
# This installs ruby-1.9.2 on Debian based distros
$ apt-get install ruby1.9.2Bundler is used to manage ruby dependencies, rubygems. Use it to install all necessary gems.
# This installs bundler
$ gem install bundler
# This installs all the dependencies into `vendor/bundle` folder
$ bundle install --deploymentThis application is developed using ruby-1.9.2, rails-3.2,
bundler-1.1.4 and rubygems-1.8.24.
Any database engine that is supported by ActiveRecord can be used, such as mysql, sqlite3 or postgresql. ActiveRecord is an ORM and it is one of the core components of Ruby on Rails.
To configure database connection define an environment variable like this:
# This uses `mysql2` adapter for the database connection
# Other adapters might require their gem to be pre-installed
ENV['DATABASE_URL'] = "mysql2://username:password@host/database-name"or you can edit config/database.yml file to configure each environment
database seperatly. It's default configuration is to use local sqlite
database.
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000Once application is successfully connected to the database server, use this command to create and migrate the database:
# This creates a database
$ rake db:create
# This creates tables etc. on the database
$ rake db:migrateSome of the database tables need to filled by initial data.
# This fills up the tables
$ rake db:seedTo enable e-mail notifications, smtp server credentials has to be set up. These configurations can be set up through environment variables during the deployment process.
ENV['SMTP_SERVER'] = "smtp.example.com"
ENV['SMTP_PORT'] = 25
ENV['SMTP_USERNAME'] = "[email protected]"
ENV['SMTP_PASSWORD'] = "pas$w0rd"This version of Ruby on Rails uses Asset Pipeline. Therefore, in the production environment assets such as images, css and javascript have to be compiled.
# This compiles all the assets into `public/assets`
$ rake assets:precompileFor the development easiest solution is to use:
# This starts WEBrick ruby server
$ rails server
=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown serveror you can use rack's rackup command, since
every rails application is also a rack application.
# This also uses WEBrick ruby server
$ rackupWEBrick is part of the ruby's standart library and great as a
development server, but there are plenty of other options to choose from
for the production environment, such as: