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:http://qiita.com/hkusu/items/cda3e8461e7a46ecf25dhttp://dev.classmethod.jp/ SERVER-SIDE/LANGUAGE/BUILD-RUBY-ENVIRONMENT-BY-RBENV/1. Install homebrew $ RUBY-E "$ (Curl-fssl https:// Raw.githubusercontent.com/homebrew/install/master/install) "2. Install Rbenv$brew installed Ruby-build$brew install Rbenv Settings path$ echo ' Export path= ' $HOME/.rbenv/bin: $PATH ' ' >> ~/.bash_profile$ Echo ' eval ' $ (rbenv init-) ' >> ~/.bash_profile$ source. Bash_profile3. Install the possible tools, package 3.1 install sublime and configure the command line to open sublimehttps://gist.github.com/ olivierlacan/1195304 after installing sublime. Create a shortcut to it under/usr/local/bin so that you can run SUBL anywhere you want to start sublime$ln-s/applications/sublime\ text\ 2.app/contents/ sharedsupport/bin/subl/usr/local/bin/sub3.2 Install Git$brew Install git3.3 use IRB (interactive ruby) package $ breW Install readline3.4 installs the package using HTTPS $ brew install OPENSSL4. Install ruby$ rbenv install-l determine the version of ruby$ rbenv installed 2.1.4 installation to use The version number used is set by the $ rbenv global 2.1.4. Assumptions are not set. Direct ruby-v see may be other version number $ rbenv versions confirm that $ ruby-v will show Ruby 2.1.4p265 (2014-10-27 revision 48166) [X86_64-darwin14.0]5. Install Rail S $ gem install rails$ gem install bundler$ rbenv rehash$ source ~/.bash_profile$ rails-v will display rails 4.2.16. Installing mysql$ Brew update$ Brew Install mysql$ Brew info MySQL confirm, also can mysql-version only see version number 7. Start rails$ Rails Server open http://localhost:3000 confirm Yes No success CTRL + C exit 8. Use mysql$ mysql.server start$ mysql-uroot Default no password assume you want to set password run the following statement $ mysql_secure_installation $ Mysql-uroot-p with Passwordmysql>exit exit $ mysql.server stop9. The second time you start your computer. Run Rails-v prompt is not installed, run ruby-v display is 2.0.0, run rbenv global 2.1.4 or unchanged.
Run Echo ' eval ' $ (rbenv init-) ' >> ~/.bash_profile (writes the rbenv initialization script to the file) (assuming insufficient permissions.) Change the file owner to user) $ source ~/.bash_profile (run the file) and then run Ruby-v and rails-v to be able. 10. Develop Ruby on railshttp://openbook4.me/projects/9211. Create the project and upload to github$git config--global user.name "username" $git config--global user.email [email protected] $git Config--global core.editor "subl-w"//config editor, here is Subl$subl ~/.netrc append below//assuming not run, each push requires input username and Passwordmachine Github.comlogin Usernamepassword password$rails New Larry-twitter//create APP$CD larry-twitter$ git init//will create Git in app folder Repo, larry-twitter$ git Add. $ git commit-m "Initialize repository" Web page on GitHub create repository, get https$ git remote add origin https://github.com/yangpeng-chn/larry-twitter.git$ git push-u Origin master hypothesis bundle Install failed (OpenSSL dependent) to run the following command: Ruby_configure_opts=--with-openssl-dir=/usr/local/cellar/openssl/1.0.2h_1 rbenv Install 1.9.3-p551===================================================================================
Configure Ruby on Rails and git on your Mac