This article will help you install and run Solidus on your local machine for the first time. This guide is aimed specifically at developers running macOS.
If you run Linux or Windows, or you don't use Homebrew on your Mac, you can still follow this guide. However, you may want to consult other documentation while installing Ruby, SQLite 3, and other dependencies on your system.
If you are still not able to get Solidus running, open an issue on GitHub with any information you think would help us reproduce the issues you're having. That would include your operating system and its version, the versions of Ruby, Rails, and SQLite 3 that you are running, and the specific error messages you are receiving during installation.
Solidus is an ecommerce platform built with Ruby on Rails . To get the most out of Solidus, we recommend that you familiarize yourself with Ruby on Rails, as well as the Ruby programming language beforehand.
Because Solidus is a Rails engine, much of what the Rails Guide on Engines explains applies directly to Solidus, too.
We also recommend configuring your development environment so that you can
install RubyGems without
The following software is required to get Solidus running:
We recommend using
to install these dependencies on your
Mac. Throughout this article, we will use the
brew command for installing
The Ruby documentation also recommends using
if you need to upgrade from your system's Ruby.
Using Homebrew, you can install all of the requirements using the following commands:
brew install ruby sqlite3 imagemagick gem install rails
See more detailed installation information below.
If you run macOS Sierra or an older OS, you system's version of Ruby will need to be upgraded from 2.0.x to 2.2.2 or newer. You can check what version of Ruby you have installed with the following command:
The Ruby documentation recommends installing another, newer instance of Ruby using Homebrew:
brew install ruby
Homebrew prioritizes the Homebrew installation of Ruby
/usr/local/bin/ruby) above the system installation (
Rails and Solidus use SQLite 3 as the default relational database. SQLite is a widely-supported, lightweight way to send and receive data. Using Homebrew, you can install the latest version of SQLite 3 using the following command:
brew install sqlite3
Alternatively, you can download the pre-compiled binary from the SQLite website .
After installation, check the version number:
If all is well, this command will return a version number that looks something
3.16.0 2016-11-04 19:09:39 0f3eed3324eda2a2b8d3301e5a43dc58a3a5fd5f.
Rails includes everything you need to build and extend a web application. Once
you have Ruby and SQLite 3 installed on your system, you can install Rails via
gem command that comes as a part of Ruby:
gem install rails
This will install Rails as well as its dependencies.
ImageMagick helps you create, edit, and save to hundreds of image file formats. It is required by Paperclip , which Solidus currently uses to handle file attachments. To install ImageMagick via Homebrew, use the command:
brew install imagemagick
Alternatively, you can download a pre-compiled binary for macOS from the ImageMagick website .
Once you have installed all of the system requirements, we can start setting up Solidus.
First, we need a new Rails project:
rails new your_solidus_project_name --skip_webpack_install
This command will create a new Rails application without installing webpacker , which is not required for a sample Solidus store. You are free to install and configure webpacker in your Solidus store though.
Once the new project has finished being created, we can open the project's newly
Gemfile in a text editor and add the required Solidus gems as new
gem 'solidus' gem 'solidus_auth_devise'
Gemfile, you are actually
requiring all five of the core Solidus gems:
For a first-time installation, we recommend requiring
solidus as it provides a
fully-functioning online store. However, you may wish to only use a subset of
the gems and create a more custom store.
Once you have saved the
Gemfile, ensure you are in your Rails project
directory, and then install the project's dependencies using Bundler.
cd /path/to/your-solidus-project-name bundle install
After the gems have been successfully installed, you need to create the necessary configuration files and instructions for the database using generators provided by Solidus and Railties.
First, run the
bundle exec rails generate spree:install
This may take a few minutes to complete, and it requires some user confirmation.
spree:install generator prompts you to configure the Solidus administrator
username and password values.
The default values are as follows:
The password must contain a minimum of 6 characters, or the account creation will fail without asking the user to try again.
Next, you need to run the
solidus:auth:install generator and install your
database migrations using the following commands:
bundle exec rails generate solidus:auth:install bundle exec rake railties:install:migrations
Finally, you need to run the migrations that Railties created. This creates the e-commerce–friendly models that Solidus uses for its database:
bundle exec rake db:migrate
Once the database migrations have been created, you should be able to successfully start the Rails server and see the sample store in your browser.
First, start the server:
bundle exec rails server
Once the server has started, you can access your store from the following URLs:
You can browse the sample store's pages and mock products, and so on.
Solidus is an open source platform supported by the community. We encourage everyone using Solius to contribute back to the documentation and the code.