A Social Network in Rails: 5-minute setup with RVM and Railsbricks
+
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?
-
Sure, help me make the right choices (default)
-
Your Rails App Name
- What do you want to name your app? App name: piccy
- Your Development Environment
- Which version of Ruby do you want to use?
- 2.2.0 (default)
- How do you usually install new gems?
- gem install name_of_gem (default)
- How do you usually run rake tasks?
- rake some_task (default)
- Which database engine do you want to use for development?
- 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?
- Yes (default)
- Add a remote Git repository?
-
No (default)
-
About Your App
- Create an authentication scheme? (Devise)
- Yes (default)
- How will users sign in?
- With a username (default)
- Allow new users to sign up?
- Yes, they can click on a ‘sign up’ button (default)
- Create test users?
- No, only create my Admin account (default)
- Create Post resources?
- No (default)
- Create a Contact form?
- No (default)
- Use Google Analytics?
- Yes (default)
-
What is your Google Analytics tracking ID? Tracking ID: UA-XXXXXX-XX
-
Configure email settings?
-
No
-
Your App UI (Bootstrap 3)
- Which UI scheme do you want to use for the content area?
- Light (default)
- Which UI scheme do you want to use for the navbar?
- Dark (default)
- Which UI scheme do you want to use for the footer?
- 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?
-
Open Sans, Helvetica, Arial, sans-serif (default)
-
Your Production Settings
- Do you want to set up some production settings already?
- Yes (default)
- Where will you host your app?
- Heroku (default)
-
What will be the URL of your app? URL: www.piccy.com
-
Do you want to use Unicorn in production?
-
Yes (default)
-
Summary
- I am ready! Generate piccy now?
- 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 :)


