1.Create new hosted workspace with 'Ruby' template on c9.io
- Install gem onotole
$ gem install onotole
- Install qt5 package on Ubuntu 14.04('capybara-webkit' gem dependancy, which is part of onotole app)
$ sudo apt-get install qt5-default
$ sudo apt-get install libqt5webkit5-dev
- Generate rails app scaffold with onotole
$ onotole projectname -c
This will generate project with mandatory gems and will provide a menu for gem selection, where you will need to choose all options
Database will not be created and migrations will fail because of unknown encoding 'UTF-8' for new postresql database. Add template: template0
to config/database.yml, development section:
development: &default
...
template: template0
and run migrations again:
rails db:create db:migrate db:seed
amend changes to last commit(if you choose to init git repository):
git add .
git commit --amend
- Change port to
8080
for puma server(config/puma.rb)
port ENV.fetch("PROJECTNAME_PORT") { 8080 }
and Guardfile in the root of your project
guard :puma, port: 8080 do
watch("Gemfile.lock")
watch(%r{^config|lib|api/.*})
end
and .env file in the root of your project(gem dotenv-rails). File must look like this:
# https://github.com/ddollar/forego
PINSHOP_ASSET_HOST=localhost:8080
PINSHOP_APPLICATION_HOST=localhost:8080
PINSHOP_PORT=8080
PINSHOP_SECRET_KEY_BASE=development_secret
PINSHOP_SMTP_ADDRESS=smtp.example.com
PINSHOP_SMTP_DOMAIN=example.com
PINSHOP_SMTP_PORT=587
PINSHOP_SMTP_PASSWORD=password
PINSHOP_SMTP_USERNAME=username
PINSHOP_WEB_CONCURRENCY=1
PINSHOP_MAX_THREADS=16
PINSHOP_COVERAGE=false # simplecov flag
RACK_ENV=development
EXECJS_RUNTIME=Node
RAILS_SERVE_STATIC_FILES=true
DEFER_GC=1 # Garbage collector flag. Used in RSpec
- Start rails server to check that app is working correctly
$ rails s -p $PORT -b $IP