{"id":4874,"date":"2019-09-28T13:43:57","date_gmt":"2019-09-28T13:43:57","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=4874"},"modified":"2024-02-22T02:15:28","modified_gmt":"2024-02-22T02:15:28","slug":"install-ruby-ror-and-rbenv-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/28\/install-ruby-ror-and-rbenv-on-ubuntu-16-04\/","title":{"rendered":"Install Ruby, ROR and RBENV on Ubuntu 16.04"},"content":{"rendered":"<p>Ref:<br \/>\nhttps:\/\/gorails.com\/setup\/ubuntu\/16.04<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"Wf6ERIX8YV\"><p><a href=\"https:\/\/www.rosehosting.com\/blog\/install-ruby-on-rails-on-ubuntu-16-04\/\">Install Ruby on Rails on Ubuntu 16.04<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Install Ruby on Rails on Ubuntu 16.04&#8221; &#8212; RoseHosting\" src=\"https:\/\/www.rosehosting.com\/blog\/install-ruby-on-rails-on-ubuntu-16-04\/embed\/#?secret=z4bu7PPatt#?secret=Wf6ERIX8YV\" data-secret=\"Wf6ERIX8YV\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><br \/>\nhttps:\/\/medium.com\/@rgdev\/how-to-install-ruby-rails-on-ubuntu-16-04-from-scratch-quickly-4da73c67daa3<\/p>\n<p>I think I already installed many packages needed like curl, nodejs and yarn. so just install this:<\/p>\n<pre class=\"lang:default decode:true \">sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev<\/pre>\n<p>Use rbenv to install ruby 2.6.3 at home:<\/p>\n<pre class=\"lang:default decode:true\">git clone https:\/\/github.com\/rbenv\/rbenv.git ~\/.rbenv\r\necho 'export PATH=\"$HOME\/.rbenv\/bin:$PATH\"' &gt;&gt; ~\/.bashrc\r\necho 'eval \"$(rbenv init -)\"' &gt;&gt; ~\/.bashrc\r\nexec $SHELL\r\n\r\ngit clone https:\/\/github.com\/rbenv\/ruby-build.git ~\/.rbenv\/plugins\/ruby-build\r\necho 'export PATH=\"$HOME\/.rbenv\/plugins\/ruby-build\/bin:$PATH\"' &gt;&gt; ~\/.bashrc\r\nexec $SHELL\r\n\r\nrbenv install 2.6.3\r\nrbenv global 2.6.3\r\nruby -v<\/pre>\n<p>output:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ ruby -v\r\nruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]<\/pre>\n<p>NOTE: Instal ruby 2.6.2 AND make it default:<\/p>\n<pre class=\"lang:default decode:true \">rbenv install 2.6.2\r\nrbenv global 2.6.2\r\nruby -v<\/pre>\n<p>CHECK:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/ruby$ ruby -v\r\nruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]<\/pre>\n<p>Then install &#8216;bundler&#8217;<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ gem install bundler\r\nFetching bundler-2.0.2.gem\r\n\/home\/teddy\/.rbenv\/rbenv.d\/exec\/gem-rehash\/rubygems_plugin.rb:6: warning: Insecure world writable dir \/home\/teddy\/.composer\/vendor\/bin in PATH, mode 040777\r\nSuccessfully installed bundler-2.0.2\r\nParsing documentation for bundler-2.0.2\r\nInstalling ri documentation for bundler-2.0.2\r\nDone installing documentation for bundler after 1 seconds\r\n1 gem installed<\/pre>\n<p>I already setup git, so no need to set it up again. check<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ ssh -T git@github.com\r\nHi advcha! You've successfully authenticated, but GitHub does not provide shell access.<\/pre>\n<p>Install Rails (v6.0.0.rc1)<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ gem install rails -v 6.0.0.rc1<\/pre>\n<p>If you&#8217;re using rbenv, you&#8217;ll need to run the following command to make the rails executable available:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ rbenv rehash<\/pre>\n<p>check:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ rails -v\r\nRails 6.0.0.rc1<\/pre>\n<p>SETUP MYSQL<br \/>\nInstall libmysqlclient-dev\u00a0gives you the necessary files to compile the\u00a0mysql2\u00a0gem which is what Rails will use to connect to MySQL when you setup your Rails app.<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo apt-get install libmysqlclient-dev<\/pre>\n<p>Let&#8217;s create your first Rails application (with mysql):<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/ruby$ rails new first-app-mysql -d mysql<\/pre>\n<p>then modify \/home\/teddy\/Documents\/ruby\/first-app-mysql\/config\/database.yml. Modify the database username, password and db name:<br \/>\n<span class=\"rcp-restricted-content-message\">SORRY, ONLY ADMIN CAN SHOW THIS!<\/span><br \/>\nCreate the database manually or run &#8216;rake db:create&#8217;<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/ruby\/first-app-mysql$ rake db:create\r\nDatabase 'first_app_mysql' already exists\r\nCreated database 'first_app_mysql_test'<\/pre>\n<p>Then run &#8216;rails server&#8217;<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/ruby\/first-app-mysql$ rails server<\/pre>\n<p>Then open on your browser: http:\/\/localhost:3000\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/gorails.com\/setup\/ubuntu\/16.04 Install Ruby on Rails on Ubuntu 16.04 https:\/\/medium.com\/@rgdev\/how-to-install-ruby-rails-on-ubuntu-16-04-from-scratch-quickly-4da73c67daa3 I think I already installed many packages needed like curl, nodejs and yarn. so just install this: sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev Use rbenv to install ruby 2.6.3 at home: git clone https:\/\/github.com\/rbenv\/rbenv.git ~\/.rbenv &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/28\/install-ruby-ror-and-rbenv-on-ubuntu-16-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Ruby, ROR and RBENV on Ubuntu 16.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-4874","post","type-post","status-publish","format-standard","hentry","category-ruby-on-rails"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=4874"}],"version-history":[{"count":7,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4874\/revisions"}],"predecessor-version":[{"id":4890,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4874\/revisions\/4890"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=4874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=4874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=4874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}