📚 Blog Archive

A Social Network in Rails: 5-minute setup with RVM and Railsbricks

· Miguel Parramón · blogger

+

This post is part of an ongoing feature about creating a social network in Rails.

Here we’ll set up the Rails app for our photo social network, codenamed Piccy.
No fumbling around with different ruby version managers and complex Rails setups: RVM + Railsbricks, done in 5 minutes:

Install rvm following the instructions on its website:

$ gpg —keyserver hkp://keys.gnupg.net —recv-keys D39DC0E3 $ \curl -sSL https://get.rvm.io | bash -s stable … $ rvm install 2.2.0 … Done!

Install the railsbricks gem and bootstrap the app. We’re using most of the default settings, shaping it up to be deployed in Heroku (+ Postgres):

$ gem install railsbricks … $ rbricks -n ***************************** * * * RailsBricks 3.1.2 * * www.railsbricks.net * * * * using Rails 4.2.0 * * * *****************************

  • Do you want me to help you along the way by giving you tips?
  1. Sure, help me make the right choices (default)

  2. Your Rails App Name


  • What do you want to name your app? App name: piccy
  1. Your Development Environment

  • Which version of Ruby do you want to use?
  1. 2.2.0 (default)
  • How do you usually install new gems?
  1. gem install name_of_gem (default)
  • How do you usually run rake tasks?
  1. rake some_task (default)
  • Which database engine do you want to use for development?
  1. PostgreSQL
  • Your database server hostname? Hostname: localhost

  • What is the database port number? Port: 5432

  • What is the development database name? Database name: piccy_development

  • What is your database username? Database username: your_username

  • What is your database user password? tip: leave blank for none Database user password:

  • Create a local Git repository?

  1. Yes (default)
  • Add a remote Git repository?
  1. No (default)

  2. About Your App


  • Create an authentication scheme? (Devise)
  1. Yes (default)
  • How will users sign in?
  1. With a username (default)
  • Allow new users to sign up?
  1. Yes, they can click on a ‘sign up’ button (default)
  • Create test users?
  1. No, only create my Admin account (default)
  • Create Post resources?
  1. No (default)
  • Create a Contact form?
  1. No (default)
  • Use Google Analytics?
  1. Yes (default)
  • What is your Google Analytics tracking ID? Tracking ID: UA-XXXXXX-XX

  • Configure email settings?

  1. No

  2. Your App UI (Bootstrap 3)


  • Which UI scheme do you want to use for the content area?
  1. Light (default)
  • Which UI scheme do you want to use for the navbar?
  1. Dark (default)
  • Which UI scheme do you want to use for the footer?
  1. Dark (default)
  • What primary color do you want to use? Primary color: #673ab7

  • Which font family and fallback options do you want to use as the main one for the UI?

  1. Open Sans, Helvetica, Arial, sans-serif (default)

  2. Your Production Settings


  • Do you want to set up some production settings already?
  1. Yes (default)
  • Where will you host your app?
  1. Heroku (default)
  • What will be the URL of your app? URL: www.piccy.com

  • Do you want to use Unicorn in production?

  1. Yes (default)

  2. Summary


  • I am ready! Generate piccy now?
  1. Do it! (default)

…

----> Piccy created successfully!

Run ‘rails server’ within piccy to start it.

Ready!

We just got:

  • A full-fledged authentication with a User model, 
  • An Admin section for all our management needs
  • A nice starting UI that can be themed later
  • Lots of other features we’ll tackle later on

And we haven’t written a single line of code yet :)

View original post →