Spree commerce is one of the most popular e-commerce platforms for online store these days. It is based on Rails framework.
Let us make it ready on a windows machine. Here are the steps:
- Install MySQL.
- Install ImageMagick (make sure you tick the option – Install development headers and libraries for C and C++).
- Downloaded and install latest Railsinstaller.
- Copy libmysql.dll file from MySQL installation folder( find it ) and paste into RailsInstaller\Ruby2.x.x\bin folder. This will allow Ruby to connect to MySQL.
- We will be using 4.2.2 version of Rails here. Execute the following command:
gem install rails -v 4.2.2
- Execute following command to install spree:
gem install spree
*Note: If you see error similar to this:
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate
then, please follow the steps from this link:
SSL upgrades on rubygems.org and RubyInstaller versions
We need to put the downloaded certificate file at:
- Now create a new rails project and give it name spree. Click here for steps.
- We will be using MySQL as our database. Create a new database named spree_store using phpmyadmin or any other UI tool like HeidiSql. Also create MySQL user named spree and password store and assign it to our database spree_store.
- Make sure Collation of your database should be set to utf8_general_ci
- Open your Gemfile and add the following line:
gem 'mysql2', '~>0.3.1'
- Also, remove sqlite gem from the file.
- Now on command prompt, inside your project directory, execute
- On Windows, I found coffe-script latest gem version to crash spree. So, add the following line to your Gemfile:
gem 'coffee-script-source', '1.8.0'
and then execute
- Now open your config\database.yml file and make it look like this:
default: &default adapter: mysql2 database: spree_store username: spree password: store pool: 5 timeout: 5000 development: <<: *default # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default production: <<: *default
- Next to install spree, execute
spree install .
Enter yes for all question for now. During installation, enter email address and password for admin.
- Now spree should be ready on your system. Execute the command:
- Now navigate to the url: