Shelly Cloud is a platform for hosting Ruby and Rails apps. This guide will show you how to:
- Install and deploy a Refinery application on the Shelly Cloud hosting platform
Before moving on to Refinery, first make sure you have the required system tools installed:
- Ruby, version 1.9.3 or higher. On Shelly Cloud the default Ruby version is 2.0.0 and it's generally better to have the same version locally
- Working compiler (to install gems with native extensions)
- on OS X you will need XCode with command line tools
- for Ubuntu install at least build-essential and autoconf packages
- PostgreSQL headers
- for OS X install postgresql via Postgres.app
- for Ubuntu it will be required to have libpq-dev installed
WARNING. Microsoft Windows isn't supported on Shelly Cloud. It's strongly discouraged to try this walkthrough on operating systems different than OS X or Linux.
As for gems, you will need to install:
- Refinery CMS - it's used to generate drafts of your future application
- ExecJS - it isn't installed with Refinery gem but it's required
You can do it by executing following command:
gem install shelly execjs refinerycms
Step by step installation guide
Step 1: If you don't have a Shelly Cloud account yet use sign up page to create one.
Step 2: Login to Shelly Cloud via command line.
$ shelly login Email (email@example.com - default): [enter your email] Password: [enter your password] Login successful Uploading your public SSH key
Step 3: Now, create refinery-with-shelly application scaffold.
$ refinerycms refinery-with-shelly … = ACTION REQUIRED = Now you can launch your webserver using: cd refinery-with-shelly rails server This will launch the built-in webserver at port 3000. You can now see Refinery running in your browser at http://localhost:3000/refinery Thanks for installing Refinery CMS, we hope you enjoy crafting your application! ————
Step 4: Go to refinery-with-shelly directory:
$ cd refinery-with-shelly
Step 5: Edit Gemfile and add :production group to the end of file.
Added gems are standard Shelly Cloud dependencies for Rails application with PostgreSQL database.
Step 6: To have assets working, it's required to use Shelly Cloud deployment hook support
Create hook file which will take care of assets precompilation on remote server.
1. config/deploy/shelly/before_migrate set -e 1. Precompile assets (this happens only on one of the servers) rake assets:precompile ``` #### Step 7: Install your Refinery instance dependencies. ```shell $ bundle install
Step 8: Test the application in local environement.
Precompile static assets.
$ rake assets:precompile
Add public/assets to .gitignore file. You don't want to have all these
files commited to the repository.
$ RAILS_ENV="production" rake db:migrate
$ rails s -e production
You can see it by entering http://localhost:3000/refinery in your browser.
NOTE: You can stop your local Rails server using CTRL+C.
Step 9: Initialize git repository and add all files to it.
Step 10: Create an application on Shelly Cloud (you can respond to all
questions with the default action).
$ shelly add $ git add Cloudfile $ git commit -m "Add application to Shelly Cloud" $ git push shelly master
Step 11: Start the newly created cloud.
$ shelly start