Giter Club home page Giter Club logo

hello_app's Introduction

Hello app


Setting up Rails development environment (OS X)

1. Preparing basic tools

  • Text editor: Atom etc
  • Terminal: iTerm etc
  • Browser: Chrome etc
  • Git

2. Install a Ruby version management tool

  • Either Ruby Version Manager (RVM) or rbenv
  • Allow you to install and manage multiple versions of Ruby on the same machine.
  • NOTE: RVM and rbenv can’t be used on the same system simultaneously
    • check $ which rvm and $ which rbenv
# Install RVM
$ \curl -sSL https://get.rvm.io | bash

# Reload this shell and initialize rvm.
$ exec bash -l

# Update rvm
$ rvm get master

# Install ruby
$ rvm install 2.3.1
# NOTE: If you get the warning below, you can safely ignore it and move on to step 3.
# * WARNING: You have '~/.profile' file, you might want to load it,
#   to do that add the following line to '/Users/adamzerner/.bash_profile':

# Configure your default version of ruby
$ rvm use 2.3.1 --default

If you ever get stuck with RVM

$ rvm help
$ rvm gemset help

Reference

Install RubyGems

  • RubyGems is a package manager for Ruby projects.
  • Provides the gem command.
  • NOTE: If you have installed RVM, you already have RubyGems, since RVM includes it automatically.
    • Check $ which gem

Install Rails

# Install Rails with a specific version number.
$ gem install rails -v 4.2.2

Creating a new app with PostgreSQL

Before starting

  • Ensure that Ruby and Rails are installed.
  • Ensure that Git initial configuration is completed.

Generate a new app (with PostgreSQL)

$ cd ~/workspace
$ rails _4.2.0_ new myapp -d postgresql
$ cd sample_app/

Install and include the gems needed by the app useing Bundler

  • Edit Gemfile.
  • Run $ bundle install --without production for the first time.
  • Run $ bundle update to update gems.

Set config/database.yml's username

  • By default, the same as your OS X user account.

Create the database

$ rake db:create

Check if it works on local server

$ rails server # Vist http://localhost:3000/

Misc techniques

Check currently installed Rails gems

$ gem list rails

hello_app's People

Contributors

mnishiguchi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.