Getting Started

This document is aimed to create and run your Metronic based Rails project in just 5 minutes. It's assumed that you already purchased Metronic  and downloaded from Metronic Downloads.

Pre Requirements

Before you install Rails, you should check to make sure that your system has the proper prerequisites installed. These include:

Rails requires Ruby version 2.7.0 or later. It is preferred to use the latest Ruby version. If the version number returned is less than that number (such as 2.3.7, or 1.8.7), you'll need to install a fresh copy of Ruby.

Assets compile require the build tools. These libraries are required as below:

HTML Features

The Starter Kit includes only the theme source code(sass, js, media, fonts and icons) from the HTML version, build tools(Gulp, Webpack), layout views and general pages(index, authentication, error) integration.
To use any feature shown in the HTML version just copy & paste the HTML code and include required assets(css, js) using the Theme Api.

Install Ruby

  1. Get the latest version of Ruby at https://www.ruby-lang.org/en/downloads/. They have several tools on each major platform to install Ruby:
    • On Linux/UNIX, you can use the package management system of your distribution or third-party tools (rbenv and RVM).
    • On macOS machines, you can use third-party tools (rbenv and RVM).
    • On Windows machines, you can use RubyInstaller.
    See the Installation page for details on using package management systems or third-party tools.
  2. Download the executable installer and run it.
  3. Open up a command line prompt. On macOS open Terminal.app; on Windows choose "Run" from your Start menu and type cmd. Verify that you have a current version of Ruby installed:
    ruby --version
    Rails requires Ruby version 2.7.0 or later. It is preferred to use the latest Ruby version. If the version number returned is less than that number (such as 2.3.7, or 1.8.7), you'll need to install a fresh copy of Ruby.

Install Rails

  1. To install Rails, use the gem install command provided by RubyGems:
    gem install rails
  2. To verify that you have everything installed correctly, you should be able to run the following in a new terminal:
    rails --version
    If it says something like "Rails 7.0.0", you are ready to continue.

Build assets

Before running the application we need to build theme assets:
  1. Start a command prompt window or terminal and change directory to starterkit/_keenthemes/tools
    cd starterkit/_keenthemes/tools
  2. Install dependencies with either one, yarn or npm:
    yarn install
    You can use either one.
    npm install
    This command will fetch all dependencies listed in starterkit/_keenthemes/tools/package.json and place them into _keenthemes/tools/node_modules folder.
  3. You can use Gulp  or Webpack  commands to bundle theme assets. The below command will compile all the assets(sass, js, media) to starterkit/assets folder:
    For gulp use command:
    gulp
    For webpack use command:
    npm run build
    Note on the package.json file. This step is very important for Webpack in Metronic template. The default package.json works for Gulp. To make it work for Webpack, you have to modify tools/package.json and remove "type": "module". Otherwise, it will cause compilation error when running the build command.

Run Rails

To run the Rails application navigate your prompt to starterkit folder and run the following command. This command will listen for changes and hot reload them.
  1. Navigate your prompt to starterkit folder.
    cd starterkit
  2. bundle install
  3. rails db:migrate RAILS_ENV=development
  4. rails server
    Keep your prompt running by default application is served on http://127.0.0.1:3000
Preview Get Help Buy Now