Spree is a complete open source e-commerce solution for Ruby on Rails. It was designed to make customization and upgrades as simple as possible and comes in the form of a Rails Engine and must be created inside a host application. Engine Yard's repository contains a Spree host application with some additional tools to help you deploy on Engine Yard. After reviewing this, you should create your own Spree application or fork this one and make the appropriate customizations.
Create and deploy the application
The code for the Spree application that you create in this procedure is in Engine Yard's public repository on GitHub.
To create the Application:
If you are not already signed in to your Engine Yard account, log in now to https://cloud.engineyard.com/
- Click on 'Add an Application':
- This launches the Create new application screen as shown below:
Set up the application as follows:
- Application Language: Ruby
- Git Repository URI:
- Application Name: This is auto-populated from the Git Repository URI i.e. spree_sample_app. Feel free to change as appropriate.
- Web Application Framework: Rails 5
- Click 'Create Application'
The Create New Environment for the 'spree_sample_app' App page appears:
- Next, you will configure and boot the Environment for the 'spree_sample_app' application.
To create the Environment:
On the 'Create New Environment' page shown above, enter a name for your Environment.
This should be a name that uniquely identifies the environment on your dashboard.
Important! This name cannot be edited after the environment is created.
Set up the environment as follows:
- Choose Puma as your Application Server Stack (*)
- Use a stable-v5 Stack
- Use Ruby 2.3 as Runtime
- Choose MySQL 5.6 as your Database Stack (**)
(*) If you don't find Puma in the application server list, refer to this link.
(**) Spree supports any database ActiveRecord does. We recommend MySQL specifically for this guide because our sample data loading procedure uses
mysqldumpand restore commands. Our sample data is considerably larger than the default one which is a better representation of a live e-commerce website. That way you can make an educated decision after appraising performance.
Click 'Create Environment' at the bottom of the page.
The Configuration for spree_demo page appears:
Booting a cluster
Now you have a chance to define the cluster configuration for this environment. Go ahead and choose a Staging Configuration to take advantage of app server redundancy and dedicated database instances. After this, feel free to experiment with different options Engine Yard recommends or spin up your own.
Click 'Boot This Configuration'.
The spree_demo environment for the spree_sample_app application appears:
Engine Yard works behind the scenes to start up the environment, configure and provision the instances, and finally deploying the app. Configuring the environment and spinning up the instances for the first time will take about 15 minutes.
Tip: If you want to refresh to double-check on progress, click Engine Yard icon on the top left of the window rather than refreshing your browser:
Verify that the deployment was successful. You should see a message similar to this:
- If you do not see a successful deploy message, click Deploy.
Run the Spree application
In this procedure, you run the Spree application that you deployed.
To run the Spree application
Verify that the indicator is green.
It might take 5 minutes or more for the new instance to load and the indicator to turn green.
Tip: A green indicator means that the instance is loaded -- it does not necessarily mean that the application has deployed successfully. A red indicator means there was a problem configuring the instance.
Click Visit Your Application.
(You can also click on HTTP for the instance.)
The Spree application appears.