{"id":175,"date":"2009-03-10T14:52:04","date_gmt":"2009-03-10T07:52:04","guid":{"rendered":"http:\/\/blog.binus-edu.com\/?p=175"},"modified":"2009-04-02T10:58:32","modified_gmt":"2009-04-02T03:58:32","slug":"how-to-install-rubyonrails-on-centos-52","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=175","title":{"rendered":"How to Install RubyOnRails on CentOS 5.2"},"content":{"rendered":"<p><span id=\"intelliTxt\"><\/p>\n<h3><span style=\"font-size: x-large;\">What is Ruby?<\/span><\/h3>\n<p class=\"rtejustify\">Ruby is a pure object-oriented programming language with a super-clean syntax that makes programming elegant and fun. Ruby successfully combines Smalltalk&#8217;s conceptual elegance, Python&#8217;s ease of use and learning, and Perl&#8217;s pragmatism. Ruby originated in Japan in the early 1990s. It has become popular worldwide in the past few years as more English-language books and documentation have become available (and its popularity has <em>really<\/em> taken off since the introduction of Rails!).<\/p>\n<p><\/span><\/p>\n<h3 class=\"rteleft\"><span style=\"font-size: x-large;\">What is Rails?<\/span><\/h3>\n<p class=\"rtejustify\">Rails is an open source Ruby framework for developing web-based, database-driven applications. What&#8217;s special about that? There are dozens of frameworks out there, and most of them have been around much longer than Rails. Why should you care about yet another framework?<\/p>\n<p class=\"rtejustify\">What would you think if I told you that you can develop a web application <em>at least<\/em> ten times faster with Rails than you can with a typical Java framework? You can&#8211;<em>without<\/em> making any sacrifices in the quality of your application! How is this possible?<\/p>\n<p class=\"rtejustify\">Part of the answer lies in the Ruby programming language. Rails takes full advantage of Ruby. The rest of the answer is in two of Rails&#8217; guiding principles: <em>less software<\/em> and <em>convention over configuration<\/em>.<\/p>\n<p class=\"rtejustify\"><em>Less software<\/em> means you write fewer lines of code to implement your application. Keeping your code small means faster development and fewer bugs, which makes your code easier to understand, maintain, and enhance. Very shortly, you will see how Rails cuts your code burden.<\/p>\n<p class=\"rtejustify\"><em>Convention over configuration<\/em> means an end to verbose XML configuration files&#8211;there aren&#8217;t any in Rails! Instead of configuration files, a Rails application uses a few simple programming conventions that allow it to figure out everything through reflection and discovery. Your application code and your running database already contain everything that Rails needs to know!<\/p>\n<p class=\"rtejustify\">Okay so basicly Ruby is the programming language it&#8217;s like the new php or something&nbsp; and the on rails part appears to be a developer software so like Visual Studio but for this ruby language&#8230;<span id=\"intelliTxt\"><\/p>\n<h3><span style=\"font-size: medium;\">General Features<\/span><\/h3>\n<p>Rails has some general and some specific characteristics.<\/p>\n<h4>Web servers<\/h4>\n<p>Rails can run on just about any web server that implements <a href=\"http:\/\/en.wikipedia.org\/wiki\/Common_Gateway_Interface\">CGI<\/a>. However, the performance of CGI is notoriously bad, so the preferred deployment of a Rails application is to use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fastcgi\">FastCGI<\/a>. There have been extensive tests of Rails application deployments with both <a href=\"http:\/\/httpd.apache.org\/\">Apache<\/a> and <a href=\"http:\/\/www.lighttpd.net\/\">LightTPD<\/a>. There is also a newcomer, <a href=\"http:\/\/www.zedshaw.com\/projects\/scgi_rails\/\">SCGI<\/a>, which rivals the performance of FastCGI without the complicated setup.<\/p>\n<p>During development, it is usually easiest just to use the <a href=\"http:\/\/www.webrick.org\/\">WEBrick<\/a> web server that comes built-in to Ruby.<\/p>\n<h4>Databases<\/h4>\n<p>Rails currently contains support for the following databases:<\/p>\n<ul>\n<li>MySQL<\/li>\n<li>PostgreSQL<\/li>\n<li>SQLite<\/li>\n<li>SQL Server<\/li>\n<li>DB2<\/li>\n<li>Oracle<\/li>\n<\/ul>\n<p>It takes approximately 100 lines of Ruby code to implement a database adapter, so adding to this list is not particularly onerous.<\/p>\n<h4>Debugging<\/h4>\n<p>When something goes wrong inside your Rails web app, you normally get a pretty detailed error display in your browser (when running in development mode). Often this is enough to diagnose the problem. When it&#8217;s not, you have other options:<\/p>\n<ul>\n<li>\n<p>Insert debugging output in your controller. For example:<\/p>\n<pre><code>render_text &quot;Got here&quot;<\/code><\/pre>\n<p><em>or<\/em><\/p>\n<pre><code>render_text &quot;user object = &quot; + user_obj<\/code><\/pre>\n<\/li>\n<li>Check the Rails log files. (Use <code>tail<\/code> on *nix systems.) Look for the files <em>development.log<\/em>, <em>production.log<\/em>, and <em>fastcgi.crash.log<\/em>. Remember that your web server has log files, too.<\/li>\n<li>Use <a href=\"http:\/\/wiki.rubyonrails.com\/rails\/show\/HowtoDebugWithBreakpoint\">breakpoints<\/a>.<\/li>\n<li>Use a commercial IDE (like <a href=\"http:\/\/www.ruby-ide.com\/ruby\/ruby_ide_and_ruby_editor.php\">ArachnoRuby<\/a>) with a built-in debugger.<\/li>\n<\/ul>\n<h4>Custom (pretty) URLs<\/h4>\n<p>The default Rails mapping of URLs to controller actions is very simple and easy to understand. Rails tries very hard to present the user with pretty URLs. Rails URLs are simple and straightforward, not long and cryptic.<\/p>\n<p>Even so, you can still customize your URLs by using the <a href=\"http:\/\/manuals.rubyonrails.com\/read\/chapter\/65\">Rails routing facility<\/a>. Rails&#8217; URL routing is flexible enough to allow you to create virtually any URL mapping scheme.<\/p>\n<p>The Rails routing facility is pure Ruby code that even allows you to use regular expressions. Because Rails does not use the web server&#8217;s URL mapping (like <code>mod_rewrite<\/code> in Apache), your custom URL mapping will work the same on every web server.<\/p>\n<h4>Unit testing<\/h4>\n<p>Rails actively facilitates unit testing:<\/p>\n<ul>\n<li>Generating new controllers, models, and scaffolding also creates corresponding unit test skeletons.<\/li>\n<li>The strict MVC architecture tends to naturally result in testable actions and components.<\/li>\n<li>Rails includes a Rake (Ruby Make) script that will automatically run all your unit tests.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<h3 class=\"rteleft\"><span style=\"font-size: medium;\">Let&#8217;s Start the Installation<\/span><\/h3>\n<p class=\"rteleft\"><em>Intall the dependencies:<\/em><\/p>\n<ol>\n<li class=\"rteleft\">Install the apache<\/li>\n<\/ol>\n<pre class=\"rteleft\"><code>    yum install httpd-devel httpd apr apr-devel apr-util-devel emacs-common mysql-devel<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; Install the mysql database<\/p>\n<pre class=\"rteleft\"><code>    yum install mysql-server<\/code>\n<\/pre>\n<p class=\"rtejustify\">&nbsp;Before i install the fastcgi i want to explain it first,<\/p>\n<p class=\"rtejustify\"><span style=\"font-size: medium;\"><em><span style=\"font-size: small;\">What web server can I use with Rails?<\/span><\/em><\/span><\/p>\n<p class=\"rtejustify\">Apache and Lighttpd are the most popular web servers for running Rails.  But any web server that supports <a class=\"existingWikiWord\" href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/mod_ruby\">mod_ruby<\/a> (Apache), <span class=\"caps\">CGI<\/span>, <span class=\"caps\">SCGI<\/span>, or <span class=\"newWikiWord\">FastCGI<a href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/FastCGI\">?<\/a><\/span> can be used.<\/p>\n<p class=\"rtejustify\">Apache is the reference web server and will be the one upon which all examples are based.<\/p>\n<p class=\"rtejustify\">You may also want to consider using <a class=\"existingWikiWord\" href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/Lighttpd\">Lighttpd<\/a> which is comparable in speed to Apache 2.0.54 using <strong><span class=\"caps\">MPM<\/span> Worker<\/strong> on Debian 3.1&mdash;this is considerably faster than Apache 1.x or 2.x <strong><span class=\"caps\">MPM<\/span> Prefork<\/strong>.  <span style=\"color: red;\"><span class=\"caps\">WARNING<\/span>: Lighttpd-1.4.10 is very buggy&mdash;use Lighttpd-1.4.11 or newer version.<\/span><\/p>\n<p class=\"rtejustify\">A newer option is to use Zed Shaw&rsquo;s <a href=\"http:\/\/www.mimbarminang.com\/1.html\">Mongrel<\/a> . Mongrel is a ruby based webserver that uses C extensions to dramatically improve performance compared to Webrick. Mongrel can be run independently or in a cluster behind a Lighttpd or Apache proxy.<\/p>\n<p class=\"rtejustify\"><em><span style=\"font-size: small;\">Which is preferred, <\/span><\/em><a class=\"existingWikiWord\" href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/mod_ruby\"><em><span style=\"font-size: small;\">mod_ruby<\/span><\/em><\/a><em><span style=\"font-size: small;\">, <\/span><\/em><em><span style=\"font-size: small;\"><a class=\"existingWikiWord\" href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/SCGI\"><span class=\"caps\">SCGI<\/span><\/a><\/span><\/em><em><span style=\"font-size: small;\"> or <span class=\"newWikiWord\">FastCGI<\/span><\/span><\/em><span class=\"newWikiWord\"><a href=\"http:\/\/wiki.rubyonrails.org\/rails\/pages\/FastCGI\"><em><span style=\"font-size: small;\">?<\/span><\/em><\/a><\/span><em><span style=\"font-size: small;\">?<\/span><\/em><\/p>\n<p class=\"rtejustify\">We&rsquo;ll divide the answer in 2 parts (FastCGI and non-FastCGI).<\/p>\n<p class=\"rtejustify\"><strong>For FastCGI:<\/strong><\/p>\n<ul>\n<li class=\"rtejustify\">with Apache 1.x, use mod_fastcgi.<\/li>\n<li class=\"rtejustify\">with Apache 2.x, use mod_fcgid.<\/li>\n<li class=\"rtejustify\">with Lighttpd, use the bundled mod_fastcgi<\/li>\n<\/ul>\n<p class=\"rtejustify\"><span class=\"caps\">NOTE<\/span>: mod_fcgid is very active and mod_fastcgi hasn&rsquo;t been updated in years.<\/p>\n<p class=\"rtejustify\"><strong>For non-FastCGI<\/strong><\/p>\n<ul>\n<li class=\"rtejustify\">mod_ruby was recently updated and is a good solution when you don&rsquo;t share your Apache server with others<\/li>\n<li class=\"rtejustify\"><span class=\"caps\">SCGI<\/span> is a simpler technology than FastCGI which is available for most web servers.<\/li>\n<\/ul>\n<p class=\"rtejustify\">I will install RubyOnRails using FastCGI<\/p>\n<p class=\"rtejustify\">&nbsp;&nbsp;&nbsp; 3.&nbsp; Install FastCGI<\/p>\n<p class=\"rteleft\">&nbsp; &nbsp; &nbsp; &nbsp; a. Download the fcgi package<\/p>\n<pre class=\"rteleft\"><code>       wget http:\/\/www.fastcgi.com\/dist\/fcgi-2.4.0.tar.gz<\/code><\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.&nbsp; Unrar the package<\/p>\n<pre class=\"rteleft\"><code>       tar -xzf fcgi-2.4.0.tar.gz<\/code><\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c.&nbsp; Go to fcgi folder and install it<\/p>\n<pre class=\"rteleft\"><code>      cd fcgi-2.4.0<\/code>\n <code>     .\/configure<\/code>\n <code>     make<\/code>\n<code>      make install<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp; 4&nbsp; Install mod_fcgid<\/p>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.&nbsp; Download the mod_fcgid package<\/p>\n<pre class=\"rteleft\"><code>     wget http:\/\/fastcgi.coremail.cn\/mod_fcgid.1.09.tar.gz<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.&nbsp; Unrar the package<\/p>\n<pre class=\"rteleft\"><code>     tar -xzf mod_fcgid.1.09.tar.gz<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c.&nbsp; Go to mod_fcgi folder and install it<\/p>\n<pre class=\"rteleft\"><code>     cd mod_fcgid.1.09<\/code>\n<code>     vi Makefile<\/code>\n     Change\n     top_dir to: top_dir = \/usr\/lib\/httpd\n     Uncomment\n     #INCLUDES and change to INCLUDES=-I \/usr\/include\/httpd -I\n     \/usr\/include\/apr-0\n <code>    make<\/code>\n<code>     make install<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp; 4.&nbsp; Install Ruby<\/p>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a. Incase the ruby was not available by default you can set it on your repository<\/p>\n<pre class=\"rteleft\"><code>     cd \/etc\/yum.repos.d\/<\/code>\n <code>    wget http:\/\/dev.centos.org\/centos\/4\/CentOS-Testing.repo<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; b. Install the ruby<\/p>\n<pre class=\"rteleft\"><code>  <\/code>   yum --enablerepo=c4-testing install ruby ruby-docs ri ruby-libs ruby-mode ruby-tcltk irb rdoc ruby-devel\n<\/pre>\n<pre class=\"rteleft\">\nNote: you may need to install ruby-irb instead of irb from the testing repo if version numbers do not match up<\/pre>\n<pre class=\"rteleft\">\n     yum --enablerepo=c4-testing install ruby ruby-docs ri ruby-libs ruby-mode ruby-tcltk ruby-irb rdoc ruby-devel\n<\/pre>\n<p class=\"rteleft\">&nbsp; 5.&nbsp; Install Ruby Gems<\/p>\n<p class=\"rteleft\"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RubyGems<\/b> is a <a class=\"mw-redirect\" title=\"Package manager\" href=\"http:\/\/en.wikipedia.org\/wiki\/Package_manager\">package manager<\/a> for the <a class=\"mw-redirect\" title=\"Ruby programming language\" href=\"http:\/\/en.wikipedia.org\/wiki\/Ruby_programming_language\">Ruby programming language<\/a> that provides a standard format for distributing Ruby programs and <a title=\"Library (computing)\" href=\"http:\/\/en.wikipedia.org\/wiki\/Library_%28computing%29\">libraries<\/a> (in a self-contained format called a &quot;gem&quot;), a tool designed to easily manage the installation of gems, and a server for distributing them. RubyGems is now part of the standard library from Ruby version 1.9.<\/p>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a. Download the ruby gems package<\/p>\n<pre class=\"rteleft\"><code>    wget http:\/\/rubyforge.org\/frs\/download.php\/11289\/rubygems-0.9.0.tgz<\/code>\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b. Unrar the package<\/p>\n<pre class=\"rteleft\"><code>    tar -xzf rubygems-0.9.0.tgz<\/code><\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c.&nbsp; Go to Ruby gems folder and setup it and update it<\/p>\n<pre class=\"rteleft\"><code>     cd rubygems-0.9.0<\/code>\n<code>     ruby setup.rb<br \/>     <\/code><code>gem update<\/code><\/pre>\n<p class=\"rteleft\"><em>Install the Rails through gems<\/em><\/p>\n<pre class=\"rteleft\"><code>gem install rails --include-dependencies<\/code><\/pre>\n<p class=\"rteleft\">When i install \/ update the&nbsp; Rails through gem on my Openvz vps (CentOS release 4.6 (Final)) i got this error :<br \/>\n&nbsp;<\/p>\n<pre class=\"rteleft\">\n[root@adityo2 rubygems]#gem update\nUpdating installed gems... Bulk updating Gem source index for: <a title=\"http:\/\/gems.rubyforge.org\" href=\"http:\/\/gems.rubyforge.org\/\">http:\/\/gems.rubyforge.org<\/a> \/usr\/lib\/ruby\/1.8\/yaml.rb:133:in `load': failed to allocate memory (NoMemoryError)<\/pre>\n<p class=\"rteleft\">After some googling it turns out that Gem need memory more than 256mb, then i try to changes my VPS memory to 1 Gb<\/p>\n<pre class=\"rteleft\">\nvzctl set 20 --save --vmguarpages 262144 vzctl set 20 --save --oomguarpages 262144 vzctl set 20 --save --privvmpages 262144<\/pre>\n<p class=\"rteleft\">then i restart the VPS<\/p>\n<pre class=\"rteleft\"><code>vzctl stop 20 vzctl start 20<\/code>\n;20 is my vps id<\/pre>\n<p class=\"rteleft\">then i try the rails gem installation again<\/p>\n<pre class=\"rteleft\"><code>gem install rails --include-dependencies<\/code><\/pre>\n<p class=\"rteleft\">then install the fcgi through gem<\/p>\n<pre class=\"rteleft\"><code>gem install fcgi<\/code>\n<\/pre>\n<p class=\"rteleft\">then install mysql<\/p>\n<pre class=\"rteleft\"><code>gem install mysql -- --with-mysql-config=\/usr\/bin\/mysql_config<br \/><br \/>Building native extensions.  This could take a while...<br \/>Successfully installed mysql-2.7<br \/>1 gem installed <\/code>\n<code>vi \/etc\/ld.so.conf<\/code>\nAdd line: \/usr\/local\/lib\n<code>\/sbin \/ldconfig<\/code><\/pre>\n<p class=\"rteleft\">Configure Apache<\/p>\n<ol>\n<li class=\"rteleft\"><code>vi \/etc\/httpd\/conf.d\/fcgid.conf<\/code><br \/>\n    <code>Insert the following:<\/code><\/li>\n<\/ol>\n<pre class=\"rteleft\">\n    LoadModule fcgid_module \/usr\/lib\/httpd\/modules\/mod_fcgid.so\n\n    &lt;IfModule mod_fcgid.c&gt;\n    SocketPath \/tmp\/fcgid_sock\/\n    AddHandler fcgid-script .fcgi\n    &lt;\/IfModule&gt;<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; Restart the httpd<\/p>\n<pre class=\"rteleft\">\n     service httpd restart\n<\/pre>\n<p class=\"rteleft\">&nbsp;&nbsp; It should install the RubyOnRails<\/p>\n<h3 class=\"rteleft\"><span style=\"font-size: medium;\">How to Test Ruby On Rails<\/span><\/h3>\n<p class=\"rteleft\">I will create a simple Test Application on my \/home\/praetorian-id.org\/public_html\/rails, i will start it by creating a simple&nbsp; project folder first on \/home\/praetorian-id.org\/public_html\/rails using this command<\/p>\n<pre class=\"rteleft\"><code>rails MyProject<br \/><br \/>By default  <\/code>Rails 2.0.2 uses sqlite3 by default. Either you:\n\n1. Install sqlite and install the sqlite-ruby gem.\n2. Specify rails -d mysql &lt;project name&gt; when creating your projects.\n3. Manually change it in config\/database.yml<\/pre>\n<p class=\"rteleft\">in this example&nbsp; i will create MyProject database<\/p>\n<pre class=\"rteleft\"><code>rails -d mysql MyProject<\/code><\/pre>\n<p class=\"rteleft\">To configure Rails not to bother with a database, open Rails&rsquo; main config file located in config\/environment.rb in your text editor of choice and find the (commented out) line that reads:<\/p>\n<pre class=\"rteleft\">\nconfig.frameworks -= [ :active_record, :active_resource, :action_mailer ]<\/pre>\n<p class=\"rteleft\">Remove the comment and modify the line so that it excludes only ActiveRecord.<\/p>\n<pre class=\"rteleft\">\nconfig.frameworks -= [ :active_record ]<\/pre>\n<p class=\"rteleft\">then enter to&nbsp; MyProject folder<\/p>\n<pre class=\"rteleft\"><code>cd MyProject<\/code><\/pre>\n<p class=\"rteleft\">then i will run the RubyOnRails<\/p>\n<pre class=\"rteleft\"><code>.\/script\/server<\/code>\n\n=&gt; Booting WEBrick... =&gt; Rails 2.1.0 application started on <a title=\"http:\/\/0.0.0.0:3000\" href=\"http:\/\/0.0.0.0:3000\/\">http:\/\/0.0.0.0:3000<\/a>\n=&gt; Ctrl-C to shutdown server; call with --help for options [2008-08-28 08:33:04] INFO WEBrick 1.3.1 [2008-08-28 08:33:04] INFO ruby 1.8.5 (2006-08-25) [i386-linux] [2008-08-28 08:33:04] INFO WEBrick::HTTPServer#start: pid=23942 port=3000\n61.247.2.31 - - [28\/Aug\/2008:08:33:17 MSD] &quot;GET \/? HTTP\/1.1&quot; 304 0\n- -&gt; \/?\n61.247.2.31 - - [28\/Aug\/2008:08:33:17 MSD] &quot;GET \/javascripts\/prototype.js HTTP\/1.1&quot; 304 0\n<a title=\"http:\/\/208.99.198.190:3000\/\" href=\"http:\/\/208.99.198.190:3000\/\">http:\/\/208.99.198.190:3000\/<\/a>? -&gt; \/javascripts\/prototype.js\n61.247.2.31 - - [28\/Aug\/2008:08:33:18 MSD] &quot;GET \/javascripts\/effects.js HTTP\/1.1&quot; 304 0\n<a title=\"http:\/\/208.99.198.190:3000\/\" href=\"http:\/\/208.99.198.190:3000\/\">http:\/\/208.99.198.190:3000\/<\/a>? -&gt; \/javascripts\/effects.js\n61.247.2.31 - - [28\/Aug\/2008:08:33:18 MSD] &quot;GET \/images\/rails.png HTTP\/1.1&quot; 304 0\n<a title=\"http:\/\/208.99.198.190:3000\/\" href=\"http:\/\/208.99.198.190:3000\/\">http:\/\/208.99.198.190:3000\/<\/a>? -&gt; \/images\/rails.png\n61.247.2.31 - - [28\/Aug\/2008:08:33:21 MSD] &quot;GET \/rails\/info\/properties HTTP\/1.1&quot; 500 10353\n<a title=\"http:\/\/208.99.198.190:3000\/\" href=\"http:\/\/208.99.198.190:3000\/\">http:\/\/208.99.198.190:3000\/<\/a>? -&gt; \/rails\/info\/properties<\/pre>\n<p class=\"rteleft\">see&nbsp; the Ruby On Rails pages on&nbsp; <em>http:\/\/localhost:3000 <br \/>\n<\/em><\/p>\n<p class=\"rteleft\"><em><img loading=\"lazy\" decoding=\"async\" height=\"612\" width=\"600\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror1.png\" alt=\"ror1\" title=\"ror1\" class=\"alignnone size-full wp-image-178\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror1.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror1-294x300.png 294w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/em><\/p>\n<p class=\"rteleft\">&nbsp;<\/p>\n<p class=\"rteleft\"><span style=\"font-size: larger;\"><strong>Ruby On Rails Common Error :<\/strong><\/span><\/p>\n<p class=\"rteleft\"><span style=\"font-size: larger;\"><strong>1.<\/strong><\/span><\/p>\n<p class=\"rteleft\"><img loading=\"lazy\" decoding=\"async\" height=\"1186\" width=\"600\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror2.png\" alt=\"ror2\" title=\"ror2\" class=\"alignnone size-full wp-image-179\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror2.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror2-518x1024.png 518w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p class=\"rteleft\">error detail :<\/p>\n<pre id=\"blame_trace\"><code>This error occurred while loading the following files: <br \/>   sqlite3<\/code><\/pre>\n<p>Error was cause Ruby On Rails are using sqlite3 ,<\/p>\n<pre class=\"rteleft\"><code>By default  <\/code>Rails 2.0.2 uses sqlite3 ,Solution =\n\n1. Install sqlite and install the sqlite-ruby gem.\n2. Specify rails -d mysql &lt;project name&gt; when creating your projects.\n3. Manually change it in config\/database.yml\n\n<\/pre>\n<p class=\"rteleft\"><span style=\"font-size: larger;\"><strong>2.<\/strong><\/span><\/p>\n<pre class=\"rteleft\"><img loading=\"lazy\" decoding=\"async\" height=\"907\" width=\"600\" class=\"alignnone size-full wp-image-181\" title=\"ror3\" alt=\"ror3\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror3.png\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror3.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror3-198x300.png 198w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>\n<\/pre>\n<p>error detail :<\/p>\n<pre>\nAccess denied for user 'root'@'localhost' (using password: NO)\n\nError was cause by the Ruby on rail database config password did not matched\nsolution : go to your project folder\n -&gt; \/config -&gt; \/database.yml\n# vi \/home\/lineabsolute.com\/public_html\/rails\/myrailsapp\/config\/database.yml\n\n<\/pre>\n<p>test:<br \/>\n&nbsp; adapter: mysql<br \/>\n&nbsp; encoding: utf8<br \/>\n&nbsp; database: myapp_test<br \/>\n&nbsp; pool: 5<br \/>\n&nbsp; username: root<br \/>\n&nbsp; password: xxxxx -&gt; enter the correct password<br \/>\n&nbsp; socket: \/var\/lib\/mysql\/mysql.sock<\/p>\n<p>production:<br \/>\n&nbsp; adapter: mysql<br \/>\n&nbsp; encoding: utf8<br \/>\n&nbsp; database: myapp_production<br \/>\n&nbsp; pool: 5<br \/>\n&nbsp; username: root<br \/>\n&nbsp; password: xxxxx  -&gt; enter the correct password<br \/>\n&nbsp; socket: \/var\/lib\/mysql\/mysql.sock<\/p>\n<p>&nbsp;<span style=\"font-size: larger;\"><strong>3.<\/strong><\/span><\/p>\n<pre><img loading=\"lazy\" decoding=\"async\" height=\"843\" width=\"600\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror4.png\" alt=\"ror4\" title=\"ror4\" class=\"alignnone size-full wp-image-183\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror4.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/03\/ror4-213x300.png 213w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>\n\nerror detail :\nUnknown database 'myapp_development'<\/pre>\n<p>&nbsp;error was cause by the myapp_development db was not created yet<\/p>\n<p>solution :<\/p>\n<p>mysql -u root -p<\/p>\n<p>mysql&gt; create database myapp_development;<br \/>\nQuery OK, 1 row affected (0.01 sec)<\/p>\n<p>mysql&gt; exit<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Ruby? Ruby is a pure object-oriented programming language with a super-clean syntax that makes programming elegant and fun. Ruby successfully combines Smalltalk&#8217;s conceptual elegance, Python&#8217;s ease of use and learning, and Perl&#8217;s pragmatism. Ruby originated in Japan in the early 1990s. It has become popular worldwide in the past few years as more [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487,494],"tags":[900,899],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-centos","category-ruby-on-rails","tag-rubyonrails","tag-rubyonrails-on-centos"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=175"}],"version-history":[{"count":2,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions\/276"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}