{"id":116,"date":"2010-11-29T23:26:33","date_gmt":"2010-11-29T21:26:33","guid":{"rendered":"\/\/www.mcgill.org.za\/stuff\/?p=116"},"modified":"2010-11-30T07:47:08","modified_gmt":"2010-11-30T05:47:08","slug":"installing-ruby-on-rails-or-not","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/116","title":{"rendered":"Installing ruby on rails, or not"},"content":{"rendered":"<p>Well, I thought I would install ruby on rails, and run it as a user under apache&#8217;s mod_fcgi.  This is entirely possible: the user account can run any code, and installing an entire library of ruby scripts should be straightforward, with write access to the user&#8217;s home directory.  For good measure, the collected wisdom of the Internet says it can be done.  And I have root.  Cool.<\/p>\n<p>The first obstacle was rewriting the fcgi wrapper so that it will launch ruby scripts with appropriate limits so that they will not kill other processes in the shared environment.  That went well &#8211; three lines of new code in the existing wrapper.  It is a wonderful piece of work.  We will run ruby on rails.  Life will be sweet.  Customers will be happy.<\/p>\n<p>Then I downloaded a rails-based CMS from radiantcms.org, extracted it, installed ruby for CentOS, and fired it up.  Surprise!  It didn&#8217;t work.  I found the <strong>public\/dispatch.fcgi<\/strong> program, and ran it.  It complained about missing include files.  Aargh.  Time to read the instructions.  Oh look, the installation instructions say to compile the config\/database.yml file with &#8220;rake db&#8221; or whatever..  That&#8217;s pretty horrid, since rake was not in the CentOS ruby package.  Where to get it?<br \/>\nOh well, the current version of rails demands ruby 1.9.2, and not 1.8.7 as shipped with CentOS, so it looks like I&#8217;ll either have to trust some flaky package from some helpful person out there, or compile it from source.  It looks like this particular project will require a script when I need it on another machine.  Not to worry, I thought, we&#8217;ll cross that bridge when we come back to it, and I downloaded the current version of ruby, and compiled it from source.  That should sort out all the troubles.  Hey, look there, I got rake.<br \/>\nSo I raked according to the instructions.  No joy.  So I installed the gem version of rails, or radiant and a few version-specific dependencies.  Suddenly I&#8217;m running as root, since gem does not understand the concept of installing code for a user.<br \/>\n<code>gem install mysql<br \/>\ngem install rails<br \/>\ngem install i18n<br \/>\ngem install rails<br \/>\ngem install i18n -v 0.4.1<br \/>\ngem install -y rails<br \/>\ngem install RedCloth<br \/>\ngem install fcgi<br \/>\ngem install radiant<br \/>\n<\/code><br \/>\nAnd after all this I got this:<br \/>\n<code>bash-3.2$ .\/dispatch.fcgi<br \/>\nCould not load extension from file: archive_extension.<br \/>\n#<br \/>\nCould not load extension from file: smarty_pants_filter_extension.<br \/>\n#<br \/>\n:29:in `require': no such file to load -- fcgi (MissingSourceFile)<br \/>\n<\/code><br \/>\nOh dear.  How about I just install the fcgi gem?<br \/>\n<code># <strong>gem install fcgi<\/strong><br \/>\nBuilding native extensions.  This could take a while...<br \/>\nERROR:  Error installing fcgi:<br \/>\nERROR: Failed to build gem native extension.<br \/>\n\/usr\/bin\/ruby extconf.rb<br \/>\nchecking for fcgiapp.h... no<br \/>\nchecking for fastcgi\/fcgiapp.h... no<br \/>\n*** extconf.rb failed ***<br \/>\nCould not create Makefile due to some reason, probably lack of<br \/>\nnecessary libraries and\/or headers.  Check the mkmf.log file for more<br \/>\ndetails.  You may need configuration options.<br \/>\nProvided configuration options:<br \/>\n--with-opt-dir<br \/>\n--without-opt-dir<br \/>\n--with-opt-include<br \/>\n--without-opt-include=${opt-dir}\/include<br \/>\n--with-opt-lib<br \/>\n--without-opt-lib=${opt-dir}\/lib<br \/>\n--with-make-prog<br \/>\n--without-make-prog<br \/>\n--srcdir=.<br \/>\n--curdir<br \/>\n--ruby=\/usr\/bin\/ruby<br \/>\n--with-fcgi-dir<br \/>\n--without-fcgi-dir<br \/>\n--with-fcgi-include<br \/>\n--without-fcgi-include=${fcgi-dir}\/include<br \/>\n--with-fcgi-lib<br \/>\n--without-fcgi-lib=${fcgi-dir}\/lib<br \/>\nGem files will remain installed in \/usr\/lib\/ruby\/gems\/1.9.1\/gems\/fcgi-0.8.8 for inspection.<br \/>\nResults logged to \/usr\/lib\/ruby\/gems\/1.9.1\/gems\/fcgi-0.8.8\/ext\/fcgi\/gem_make.out<br \/>\n<\/code><br \/>\nHuh?  Now, everyone with the most basic knowledge of rails or radiant or ruby knows exactly how to fix this.  However, I will never acquire this basic knowledge, as I have no more patience with this series of continual roadblocks.   After a few hours of trying, I&#8217;m sick of it.  It is a horrible system.<\/p>\n<p>My feeling about ruby on rails:<\/p>\n<ul>\n<li>It is immature.  Mature technology just works.  It does not just work.<\/li>\n<li>It will never come near to replacing the horrible monstrosity that is php &#8211; not in this form.<\/li>\n<li>You absolutely require root access to be able to get it going, and therefore to maintain it as well.  This means it is not suitable for a shared platform.<\/li>\n<\/ul>\n<p>This is calculated to attract angry attention from those that love and\/or wrote ruby on rails (or maybe read a glowing HOWTO about it).  They will say things like I did not pay for it, they will point out how thankless and ungrateful I am for their hard work.  They will say &#8220;if you want help, you should have a better attitude.&#8221;  They might even notice that I am stupid.  They might be right, but I should mention that it was not entirely my idea to install their junk.<\/p>\n<p>So what now?\u00a0 If anyone asks, we (the folks I work for) do support Ruby on Rails.\u00a0 We will provide you with a dedicated server and you can install it there.\u00a0 Hang, if you ask nicely, we might even install it for you.\u00a0 You can manage your own private dependency hell on your own private server, and not break anyone else&#8217;s dependency hell.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I thought I would install ruby on rails, and run it as a user under apache&#8217;s mod_fcgi. This is entirely possible: the user account can run any code, and installing an entire library of ruby scripts should be straightforward, &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/116\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[17,18,190],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-stuff","tag-rants","tag-ruby","tag-stuff"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":9,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/116\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}