Ruby Environment Installation Draft

Source: Internet
Author: User

Installing homebrew
Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"


Brew Search
Brew Install Nginx

Install rails under VPN
http://blog.csdn.net/xunyn/article/details/17069521
Https://ruby-china.org/wiki/install_ruby_guide
Http://stackoverflow.com/questions/15514865/brew-update-errors


Install RVM
Https://ruby-china.org/wiki/install_ruby_guide
Install Ruby under VPN
if ruby-v = = 2.1.1
RVM System--default
Else
RVM Install 2.1.1 #under VPN
RVM 2.1.1--default

Bundle Install # Install all in Gemfile

If error
Brew Install MySQL
Mysqld

CP Database.yml.example DATABASE.YML
Vim Config/database.yml
Rake Db:create:all
Rake Db:migrate
Rails S

Rake-t| grep seed
Executes all seek commands.


Rake Assets:precompile rails_env=production

If you use System Ruby, the gem is installed under the ~/.gem folder
If you use RVM to install Ruby, the gem is installed under ~/.rvm/.gem

Rails is also a gem


1. The rails s command line can display the request module and profile information for each request.

Request a home page. First visit: routes.rb

Root ' Home#index '
Resources:roles

Routing to: HOME_CONTROLLER.RB

skip_before_filter:authenticate_user! Skip user authentication
skip_authorization_check//Skip user authentication
Before_action:redirect_to_login_if_in_subdomain//If it is a level two domain name, jump to login interface

def index
End

The index function is empty and looks directly for Views/layouts/home.html.erb-Views/home

Different actions make some style changes based on the action.


Http://localhost:3000/login

Request Login Interface: ROUTES.RB

Get "/login" = "sessions#new"

Devise.sessions_controller

Prepend_before_filter:require_no_authentication, only: [: New,: Create]
prepend_before_filter:allow_params_authentication!, only:: Create
Prepend_before_filter only: [: Create,:d Estroy] {request.env["devise.skip_timeout"] = true}

# get/resource/sign_in
def NEW
Self.resource = Resource_class.new (sign_in_params)
Clean_up_passwords (Resource)
Respond_with (Resource, serialize_options (Resource))
End

Ruby Environment Installation Draft

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.