Reference Links:
Postgres Install using Homebrew
-
Open Terminal.
-
Create and enter our working directory:
mkdir Workspace
cd Workspace
mkdir solidus-workshop
cd solidus-workshop
- Install X-Code (if you haven't already):
xcode-select --install
Optional: check if system ruby is already installed (it should be):
ruby -v
- Install Homebrew:
(check for previous installation with brew doctor
)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(And make sure it, homebrew's executable directory (/usr/local/bin) has added to your path)
- Now go for a checkup at the doctor's with:
brew doctor
(And fix anything it complains about, possible brew update
)
- Install rbenv:
(check for previous installation with rbenv -v
; optional upgrade for those already with rbenv installed brew upgrade rbenv ruby-build
)
brew install rbenv
(note: this also installs ruby-build
)
And initialize it:
rbenv init
And then check to see it's properly installed:
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
And then add it to your path:
rbenv init
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
- Install Ruby:
Check available versions:
rbenv install -l
Install your selected version, and set it:
rbenv install 2.4.6
rbenv local 2.4.6
- Install git, check the version, and set your name and email:
brew install git
git --version
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
- Install postgres:
brew install postgresql
brew services start postgresql
pgsql postgres #to login
- Install Imagemagick, Bundler, update gem, and install rails:
brew install imagemagick
gem install bundler
gem update --system
gem install rails
OR
gem install rails -v '5.2.3' -V --no-ri --no-rdoc
- Create a new Rails app
rails new my-solidus-website --database=postgresql
OR
rails _5.2.3_ new my-solidus-website --database=postgresql
- Add Solidus gems
gem 'solidus', '~> 2.5'
gem 'solidus_auth_devise'
gem 'deface'
Final Commands:
Run thse to finish setting up the Solidus Project:
bundle exec rails g spree:install
bundle exec rails g solidus:auth:install
bundle exec rake railties:install:migrations
bundle exec rake db:migrate
Start the server!
bundle exec rails s