{"id":788,"date":"2018-06-08T01:38:35","date_gmt":"2018-06-08T08:38:35","guid":{"rendered":"http:\/\/cywang.no-ip.org\/wordpress\/?p=788"},"modified":"2018-06-08T01:44:28","modified_gmt":"2018-06-08T08:44:28","slug":"install-ruby-on-rails-with-rbenv-on-rhel-7-5","status":"publish","type":"post","link":"http:\/\/cywang.no-ip.org\/wordpress\/?p=788","title":{"rendered":"Install Ruby on Rails with rbenv on RHEL 7.5"},"content":{"rendered":"<p><strong>Install Dependencies<\/strong><\/p>\n<pre><code class=\"language-bash\">yum install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl postgresql-devel<\/code><\/pre>\n<p><strong>Install rbenv<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-bash\">\r\ncd\r\ngit clone git:\/\/github.com\/sstephenson\/rbenv.git .rbenv\r\necho 'export PATH=\"$HOME\/.rbenv\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile\r\necho 'eval \"$(rbenv init -)\"' &gt;&gt; ~\/.bash_profile\r\nexec $SHELL\r\ngit clone git:\/\/github.com\/sstephenson\/ruby-build.git ~\/.rbenv\/plugins\/ruby-build\r\necho 'export PATH=\"$HOME\/.rbenv\/plugins\/ruby-build\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile\r\nexec $SHELL<\/code><\/pre>\n<p><!--more--><\/p>\n<p>.bash_profile<\/p>\n<pre class=\"line-numbers\"><code class=\"language-bash\">\r\n# .bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n\t. ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nPATH=$PATH:$HOME\/bin\r\n\r\nexport PATH\r\nexport PATH=\"$HOME\/.rbenv\/bin:$PATH\"\r\neval \"$(rbenv init -)\"\r\nexport PATH=\"$HOME\/.rbenv\/plugins\/ruby-build\/bin:$PATH\"<\/code> source ~\/.bash_profile<\/pre>\n<p><strong>List Ruby version<\/strong><\/p>\n<pre><code class=\"language-bash\">\r\nrbenv install -l\r\n2.4.4\r\n2.5.0-dev\r\n2.5.0-preview1\r\n2.5.0-rc1\r\n2.5.0\r\n2.5.1\r\n2.6.0-dev\r\n2.6.0-preview1\r\n2.6.0-preview2\r\n<\/code><\/pre>\n<p><strong>Install Ruby 2.5.1<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-bash\">\r\nrbenv install -v 2.5.1\r\nrbenv global 2.5.1<\/code><\/pre>\n<p><strong>Check Ruby\u00a0version<\/strong><\/p>\n<pre><code class=\"language-bash\">\r\n# ruby -v\r\nruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]<\/code><\/pre>\n<p><strong>Install Bundler<\/strong><\/p>\n<pre><code class=\"language-bash\">gem install bundler<\/code><\/pre>\n<p><strong>Install Rails 5.2.0<\/strong><\/p>\n<pre><code class=\"language-bash\">gem install rails -v 5.2.0<\/code><\/pre>\n<p><strong>Check Ruby on Rails version<\/strong><\/p>\n<pre><code class=\"language-bash\">\r\n# rails -v\r\nRails 5.2.0<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Reference<\/strong><\/p>\n<p><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-ruby-on-rails-with-rbenv-on-centos-7\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-ruby-on-rails-with-rbenv-on-centos-7<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install Dependencies yum install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl postgresql-devel Install rbenv cd git clone git:\/\/github.com\/sstephenson\/rbenv.git .rbenv echo &#8216;export PATH=&#8221;$HOME\/.rbenv\/bin:$PATH&#8221;&#8216; &gt;&gt; ~\/.bash_profile echo &#8216;eval &#8220;$(rbenv init -)&#8221;&#8216; &gt;&gt; &hellip; <a href=\"http:\/\/cywang.no-ip.org\/wordpress\/?p=788\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[32],"tags":[],"class_list":["post-788","post","type-post","status-publish","format-standard","hentry","category-ruby-on-rails"],"_links":{"self":[{"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=788"}],"version-history":[{"count":5,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions"}],"predecessor-version":[{"id":793,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions\/793"}],"wp:attachment":[{"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=788"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cywang.no-ip.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}