[{"data":1,"prerenderedAt":348},["ShallowReactive",2],{"post:\u002F2017\u002F09\u002F06\u002Fruby-on-rails-part-1-rails-new":3},{"id":4,"title":5,"body":6,"date":339,"description":12,"extension":340,"meta":341,"navigation":342,"path":343,"seo":344,"stem":345,"subtitle":346,"__hash__":347},"posts\u002F2017\u002F09\u002F06\u002Fruby-on-rails-part-1-rails-new.md","Ruby on Rails: Part 1 - Rails new",{"type":7,"value":8,"toc":337},"minimark",[9,13,16,22,25,30,33,38,187,190,197,200,203,206,211,214,219,222,247,250,253,295,298,323,326,333],[10,11,12],"p",{},"Now that everything is set up and ready to go, its time to start. Open up your terminal.",[10,14,15],{},"Im going to call this application pic_aggregator, original I know",[10,17,18],{},[19,20,21],"code",{},"rails new pic_aggregator",[10,23,24],{},"Now to cd into the new directory",[10,26,27],{},[19,28,29],{},"cd pic_aggregator",[10,31,32],{},"That's it, rails has generated all of the files necessary for you, just like that. crazy right?\nNow lets see what our brand-spanking new site looks like. For that we'll have to spin up our server for the first time.",[10,34,35],{},[19,36,37],{},"rails s",[39,40,45],"pre",{"className":41,"code":42,"language":43,"meta":44,"style":44},"language-shell shiki shiki-themes github-dark","=> Booting WEBrick\n=> Rails 4.2.6 application starting in development on http:\u002F\u002Flocalhost:3000\n=> Run `rails server -h` for more startup options\n=> Ctrl-C to shutdown server\n[2017-09-06 18:03:23] INFO  WEBrick 1.3.1\n[2017-09-06 18:03:23] INFO  ruby 2.3.1 (2016-04-26) [x86_64-darwin16]\n[2017-09-06 18:03:23] INFO  WEBrick::HTTPServer#start: pid=56174 port=3000\n","shell","",[19,46,47,66,98,131,150,156,168],{"__ignoreMap":44},[48,49,52,56,60,63],"span",{"class":50,"line":51},"line",1,[48,53,55],{"class":54},"sU2Wk","=",[48,57,59],{"class":58},"s95oV","> ",[48,61,62],{"class":54},"Booting",[48,64,65],{"class":54}," WEBrick\n",[48,67,69,71,73,76,80,83,86,89,92,95],{"class":50,"line":68},2,[48,70,55],{"class":54},[48,72,59],{"class":58},[48,74,75],{"class":54},"Rails",[48,77,79],{"class":78},"sDLfK"," 4.2.6",[48,81,82],{"class":54}," application",[48,84,85],{"class":54}," starting",[48,87,88],{"class":54}," in",[48,90,91],{"class":54}," development",[48,93,94],{"class":54}," on",[48,96,97],{"class":54}," http:\u002F\u002Flocalhost:3000\n",[48,99,101,103,105,108,111,115,118,121,124,128],{"class":50,"line":100},3,[48,102,55],{"class":54},[48,104,59],{"class":58},[48,106,107],{"class":54},"Run",[48,109,110],{"class":54}," `",[48,112,114],{"class":113},"svObZ","rails",[48,116,117],{"class":54}," server ",[48,119,120],{"class":78},"-h",[48,122,123],{"class":54},"`",[48,125,127],{"class":126},"snl16"," for",[48,129,130],{"class":58}," more startup options\n",[48,132,134,136,138,141,144,147],{"class":50,"line":133},4,[48,135,55],{"class":54},[48,137,59],{"class":58},[48,139,140],{"class":54},"Ctrl-C",[48,142,143],{"class":54}," to",[48,145,146],{"class":54}," shutdown",[48,148,149],{"class":54}," server\n",[48,151,153],{"class":50,"line":152},5,[48,154,155],{"class":58},"[2017-09-06 18:03:23] INFO  WEBrick 1.3.1\n",[48,157,159,162,165],{"class":50,"line":158},6,[48,160,161],{"class":58},"[2017-09-06 18:03:23] INFO  ruby 2.3.1 (",[48,163,164],{"class":113},"2016-04-26",[48,166,167],{"class":58},") [x86_64-darwin16]\n",[48,169,171,174,176,179,182,184],{"class":50,"line":170},7,[48,172,173],{"class":58},"[2017-09-06 18:03:23] INFO  WEBrick::HTTPServer#start: pid",[48,175,55],{"class":126},[48,177,178],{"class":54},"56174",[48,180,181],{"class":58}," port",[48,183,55],{"class":126},[48,185,186],{"class":54},"3000\n",[10,188,189],{},"Now that the server is up and running it time to see the website in action.",[10,191,192],{},[193,194],"img",{"alt":195,"src":196},"welcome aboard!","https:\u002F\u002Fnamecheap.simplekb.com\u002F\u002FSiteContents\u002F2-7C22D5236A4543EB827F3BD8936E153E\u002Fmedia\u002Frorapp6.png",[10,198,199],{},"And just like that we're up and running, we're currently riding rails!",[10,201,202],{},"Ok, we've got momentum and all we want to do now is to go balls-to-the wall creating models, scaffolds and controllers but before that GitHub needs a moment. As of right now if anything major goes wrong we're screwed.",[10,204,205],{},"First thing's first, we need to initialize this folder as a git repository.",[10,207,208],{},[19,209,210],{},"git init",[10,212,213],{},"Add the files in your new local repository. This stages them for the first commit.",[10,215,216],{},[19,217,218],{},"git add .",[10,220,221],{},"Commit the files that you've staged in your local repository.",[39,223,225],{"className":41,"code":224,"language":43,"meta":44,"style":44},"git commit -m \"First commit\"\n# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.\n",[19,226,227,241],{"__ignoreMap":44},[48,228,229,232,235,238],{"class":50,"line":51},[48,230,231],{"class":113},"git",[48,233,234],{"class":54}," commit",[48,236,237],{"class":78}," -m",[48,239,240],{"class":54}," \"First commit\"\n",[48,242,243],{"class":50,"line":68},[48,244,246],{"class":245},"sAwPA","# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.\n",[10,248,249],{},"At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.",[10,251,252],{},"In Terminal, add the URL for the remote repository where your local repository will be pushed.",[39,254,256],{"className":41,"code":255,"language":43,"meta":44,"style":44},"git remote add origin remote REPOSITORY_URL\n# Sets the new remote\ngit remote -v\n# Verifies the new REMOTE_URL\n",[19,257,258,276,281,290],{"__ignoreMap":44},[48,259,260,262,265,268,271,273],{"class":50,"line":51},[48,261,231],{"class":113},[48,263,264],{"class":54}," remote",[48,266,267],{"class":54}," add",[48,269,270],{"class":54}," origin",[48,272,264],{"class":54},[48,274,275],{"class":54}," REPOSITORY_URL\n",[48,277,278],{"class":50,"line":68},[48,279,280],{"class":245},"# Sets the new remote\n",[48,282,283,285,287],{"class":50,"line":100},[48,284,231],{"class":113},[48,286,264],{"class":54},[48,288,289],{"class":78}," -v\n",[48,291,292],{"class":50,"line":133},[48,293,294],{"class":245},"# Verifies the new REMOTE_URL\n",[10,296,297],{},"then you just need to push the changes in your local repository to GitHub.",[39,299,301],{"className":41,"code":300,"language":43,"meta":44,"style":44},"git push -u origin master\n# Pushes the changes in your local repository up to the remote repository you specified as the origin\n",[19,302,303,318],{"__ignoreMap":44},[48,304,305,307,310,313,315],{"class":50,"line":51},[48,306,231],{"class":113},[48,308,309],{"class":54}," push",[48,311,312],{"class":78}," -u",[48,314,270],{"class":54},[48,316,317],{"class":54}," master\n",[48,319,320],{"class":50,"line":68},[48,321,322],{"class":245},"# Pushes the changes in your local repository up to the remote repository you specified as the origin\n",[10,324,325],{},"And that's it, in the space of just a few short minutes we have a website, running locally on our server and the code safely stored on the cloud. kicking ass and taking names!",[10,327,328],{},[329,330,332],"a",{"href":331},"\u002F2017\u002F09\u002F06\u002Fruby-on-rails-part-2-putting-the-m-in-mvc","Part 2; Putting the M in MVC",[334,335,336],"style",{},"html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}",{"title":44,"searchDepth":68,"depth":68,"links":338},[],"2017-09-06 20:33","md",{},true,"\u002F2017\u002F09\u002F06\u002Fruby-on-rails-part-1-rails-new",{"title":5,"description":12},"2017\u002F09\u002F06\u002Fruby-on-rails-part-1-rails-new",null,"qol-Rvfuz1rPA6UAUDD8Ui0AQ3kG3wg7W_eNQLSWATM",1791634646481]