Skip to content

Instantly share code, notes, and snippets.

@x-yuri
Last active February 8, 2021 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x-yuri/bd09819aa2ee00d82be100525fa8318e to your computer and use it in GitHub Desktop.
Save x-yuri/bd09819aa2ee00d82be100525fa8318e to your computer and use it in GitHub Desktop.
#rails #create

Create a Rails site

Rails 4:

a.sh:

#!/bin/sh -eu
apk add build-base sqlite-dev nodejs tzdata
cat <<GEMFILE >Gemfile
source 'https://rubygems.org'
gem 'rails', '~> 4.0'
gem 'nokogiri', '< 1.11.0'
GEMFILE
bundle
rails new app
cd app
sed -Ei "s/gem 'sqlite.*/gem 'sqlite3', '~> 1.3.6'/" Gemfile
bundle
read
$ docker run --rm -itv $PWD/a.sh:/a.sh ruby:2.4-alpine ./a.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment