Spree eCommerce is a leading open-source eCommerce platform built with Ruby on Rails. It makes it super easy to develop and host your online storefront and sell your products directly to your customers.
Spree is an excellent place to start if you want an open-source eCommerce platform that is scalable and performs at a high level.
Spree is built on an open-source core with support for open standards, which might be very useful in helping you run your digital content…
This eCommerce platform is designed for ease of use to allow enterprises and business owners to collaborate and automate engaging experiences with users across multiple devices, including mobile…
For more about Spree, please check their Homepage
- Ruby version 2.5.3
- Rails version 5.2.1
Install Ruby
You’ll need to install some dependencies to install Ruby and Rails on Ubuntu. To make that happen, install Node.js and Yarn repositories. This will make installing the dependencies easier.
First, install these curl and git packages.
sudo apt update sudo apt install curl git
Then, run the commands below to add Node.js and Yarn repositories and keys to your system. Then, install some core packages to get your environment going.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install nodejs yarn zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
When you’re done, Continue below:
After adding the repositories and installing the necessary packages above, install Ruby with your local profile settings using rbenv. You’ll then use rbenv to install ruby-build.
cd ~/ git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc exec $SHELL git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc exec $SHELL
After setting up your local profile, run the commands below to install Ruby version 2.5.3. If a newer version is available, replace the version number with that. Then, visit this site to find out about Ruby’s latest versions.
rbenv install 2.5.3 rbenv global 2.5.3
To verify that Ruby is installed, run the commands below:
ruby -v
You should see similar lines below:
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
Another package management you’ll want to install is bundler. to do that, run the commands below
gem install bundler
Now run the command below after installing the bundler.
rbenv rehash
Install Rails
Now that the Ruby environment is set up run the commands below to install Rails. Rails can be installed from Node.Js. First, run the commands below to install the Node.js repository, then install the Node.js package.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
Now that Node.js is installed run the commands below to install Rails.
gem install rails -v 5.2.1
Don’t forget to rehash your Rbenv environment and install new packages.
rbenv rehash
To verify if Rails is installed, run the commands below.
rails -v
You should see something similar to the lines below:
Rails 5.2.1
Install Spree eCommerce
Now that your environment is ready run the commands below to install Spree eCommerce and build your first site. Next, run the commands below.
rails new spree
Next, change it into the spree folder and install it there.
cd ~/spree
Then, run the commands to open the Gemfile there.
nano Gemfile
Please copy and paste the lines below into the file and save them when it opens.
gem 'spree', '~> 3.6.4' gem 'spree_auth_devise', '~> 3.3' gem 'spree_gateway', '~> 3.3'
Then the file should look like this:
ruby '2.5.3'
#spree
gem 'spree', '~> 3.6.4'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
Save and exit.
After that, run the commands below:
bundle install
After a while, the necessary packages should be installed. When you’re done, run the commands below to create an admin user and install Spree.
You will be prompted to create an admin email address and a password.
rails g spree:install --user_class=Spree::User rails g spree:auth:install rails g spree_gateway:install
Finally, run the commands below to start the server.
rails server --binding=0.0.0.0
Now open your browser and browse to the hostname followed by port # 3000
You should see Spree’s home page.

Log on to the backend using the admin address and password.
http://localhost:3000/admin

You can always perform any of these steps later by using these commands.
bundle exec rake railties:install:migrations bundle exec rake db:migrate bundle exec rake db:seed bundle exec rake spree_sample:load
Congratulation! You have successfully installed the Spree eCommerce platform on Ubuntu 16.04 | 18.04 | 18.10
Leave a Reply