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