{"id":1011,"date":"2014-10-14T12:06:42","date_gmt":"2014-10-14T12:06:42","guid":{"rendered":"http:\/\/tw.newtonstudio.com\/?p=1011"},"modified":"2014-10-14T13:03:51","modified_gmt":"2014-10-14T13:03:51","slug":"how-to-install-rails-on-aws-linux-server","status":"publish","type":"post","link":"http:\/\/tw.newtonstudio.com\/?p=1011","title":{"rendered":"How to install Rails on AWS Linux Server"},"content":{"rendered":"<p>As a newbie of Rails, we might need to try this web application on AWS server, especially AWS providing Free tier Server for us. I use t2.micro as a testing server in this scenario.<\/p>\n<p><strong>Step One\u2014Install Ruby<\/strong><br \/>\n1. sudo yum install ruby (in my server, ruby is already installed, you may check by using this command)<\/p>\n<p><strong>Install necessary packages and libraries<\/strong><br \/>\n2. sudo yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel<\/p>\n<p>3. sudo yum install ruby-rdoc ruby-devel<\/p>\n<p><strong>Step Two\u2014Install Ruby Gems<\/strong><br \/>\n4. sudo yum install rubygems<\/p>\n<p><strong>Step Three\u2014Install Rails<\/strong><br \/>\n5. sudo gem update<\/p>\n<p>6. sudo gem update &#8211;system<\/p>\n<p>7. sudo gem install rails<\/p>\n<p><strong>Step 8 lacking repositories<\/strong><br \/>\n8. gem install io-console<br \/>\n9. gem install json<br \/>\n10. sudo yum install nodejs npm &#8211;enablerepo=epel<\/p>\n<p><strong>Step 9 remember to open port 3000 from AWS security Group<\/strong><\/p>\n<p><strong>Step 10 Try to create a blog web application<\/strong><br \/>\n11. cd \/home\/ec2-user<br \/>\n12. rails new blog<br \/>\n13. cd blog<\/p>\n<p><strong>Step 11 Start the server!<\/strong><br \/>\n14. rails server<\/p>\n<p><strong>Step 12 Open your browser and take a look<\/strong><br \/>\n15 http:\/\/x.x.x.x:3000<br \/>\n<a class=\"thumbnail\" href=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2014\/10\/rails.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1018\" title=\"rails\" src=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2014\/10\/rails.jpg\" alt=\"\" width=\"937\" height=\"625\" srcset=\"https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2014\/10\/rails.jpg 937w, https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2014\/10\/rails-300x200.jpg 300w\" sizes=\"auto, (max-width: 937px) 100vw, 937px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>15. cd \/home\/ec2-user\/blog<\/p>\n<p>16. vi Gemfile<\/p>\n<p>17. add &#8220;gem &#8216;io-console'&#8221; at the top of the file, so that you can execute &#8220;rails generate controller welcome index&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a newbie of Rails, we might need to try this web app [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[201,232,231,230,229],"class_list":["post-1011","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-aws","tag-gem-install","tag-linux","tag-rails","tag-ruby"],"_links":{"self":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/1011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":7,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1017,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1017"}],"wp:attachment":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}