Configure Ruby on Rails and Git and railsgit on Mac
Ruby on Rails on Mac ======================================== ========================================================== ========= http://morizyun.github.io/blog/marvericks-rails-setup-ruby-rvm-msyql/for general: useful: http://qiita.com/keneo/items/0a58b188183b5100e3affor mysql: Snapshot $ r Uby-e "$ (curl-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. install rbenv $ brew install ruby-build $ brew install rbenv set path $ echo 'export PATH = "$ HOME /. rbenv/bin: $ PATH "'>. bash_profile $ echo 'eval "$ (rbenv init-)" '>. bash_profile $ source. bash_profile3. install possible tools, package 3.1 install sublime and configure to open sublimehttps: // configure with command line Method, in this way, subl can be executed anywhere to start sublime $ ln-s/Applications/Sublime \ Text \ 2.app/ Contents/SharedSupport/bin/subl/usr/local/bin/sub3.2 to install git. $ rew install git3.3 use irb (interactive ruby) package $ brew install readline3.4 install the package using https $ brew install openssl4. install ruby $ rbenv install-l determine which ruby can be installed $ rbenv install 2.1.4 install the version to use $ rbenv global 2.1.4 set the version used, if this parameter is not set, ruby-v may see other versions. $ rbenv versions confirms that $ ruby-v will display ruby 2.1.4p. 265 (revision 48166) [x86_64-darwin14.0] 5. install rails $ gem install bundler $ rbenv rehash $ source ~ /. Bash_profile $ rails-v displays rails 4.2.16. install MySql $ brew update $ brew install mysql $ brew inf ömysql. You can also check mysql-version only for version 7. start rails $ rails server, open http: // localhost: 3000, and check whether Ctrl + c is successful. Exit 8. use MySql $ mysql. server start $ mysql-uroot has no password by default. If you want to set a password, run the following statement $ mysql_secure_installation $ mysql-uroot-p with password mysql> exit to exit $ mysql. server stop9. after the computer is started for the second time, run rails-v to prompt that it is not installed. Run ruby-v to display 2.0.0. Run rbenv global 2.1.4 and Yes. Run $ echo 'eval "$ (rbenv init-)" '> ~ /. Bash_profile (write the rbenv initialization script to the file) (if the permission is insufficient, modify the file owner as the user) $ source ~ /. Bash_profile (execute this file) and then execute ruby-v rails-v. 10. develop Ruby on Railshttp: // openbook4.me/projects/9211. create a project and upload it to github $ git config -- global user. name "too many users named" $ git config -- global user. email email@example.com $ git config -- global core. editor "subl-w" // configuration editor. Here is subl $ subl ~ /. Add the following to netrc: // if not executed, enter username and passwordmachine github for each push. comlogin USERNAMEpassword PASSWORD $ rails new larry-twitter // create app $ cd larry-twitter $ git init // git repo and larry-twitter $ git add will be created under the app directory. $ git commit-m "Initialize repository" create a repository on github, obtain https $ git remote add origin https://github.com/yangpeng-chn/larry-twitter.git$ git push-u origin master ========================== ========================================================== ============================