Skip to content
Lino Moretto edited this page Dec 6, 2016 · 3 revisions

Magnet itself is a common Rails 5 application, which can be downloaded from Github simply by cloning it to your local development machine:

$ git clone https://github.com/linucs/magnet.git
Cloning into 'magnet'...
remote: Counting objects: 3403, done.
remote: Compressing objects: 100% (2600/2600), done.
remote: Total 3403 (delta 723), reused 3403 (delta 723), pack-reused 0
Receiving objects: 100% (3403/3403), 9.11 MiB | 301.00 KiB/s, done.
Resolving deltas: 100% (723/723), done.
Checking connectivity... done.

At this point, a working suitable installation of the Ruby interpreter and Rubygems are needed. Using RVM, rbenv or any other Ruby version management software is strongly reccomended, since Magnet has been developed and tested with MRI 3.2.1

Navigate into the newly created folder, and launch bundler to install all the required dependencies:

$ cd magnet && bundle install
Using rake 11.3.0
Using concurrent-ruby 1.0.2
Using i18n 0.7.0
...
...
...
Bundle complete! 94 Gemfile dependencies, 216 gems now installed.
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

Ok, it's now time to configure Magnet to function properly.

ActiveRecord configuration

As usual in Rails apps, config/database.yml holds the configuration settings for the ActiveRecord adapter to the underlying RDBMs.

The provided sample configuration file can be used as a stating point:

$ cd config
$ cp database.yml.example database.yml

Please refer to the official guides for any further information on this topic.

MongoID configuration

Magnet uses the MongoID gem to handle persistence in MongoDB. config/mongoid.yml holds the configuration settings for the MongoID adapter to the underlying MongoDB service.

The provided sample configuration file can be used as a stating point:

$ cd config
$ cp mongoid.yml.example mongoid.yml

Please refer to the official tutorial for any further information on this topic.

Sidekiq configuration

Besides the default one, Magnet uses two different Redis queues (slow_poll and fast_poll) to handle asynchronous processing via Sidekiq; the main configuration file is located in config/sidekiq.yml

Please refer to the official wiki and the sidekiq-limit_fetch gem (used to gain more granula control over scheduling) for any further information on this topic.


Next: Application configuration