{"id":179,"date":"2010-12-20T04:54:04","date_gmt":"2010-12-20T09:54:04","guid":{"rendered":"http:\/\/wcarss.ca\/log\/?p=179"},"modified":"2010-12-26T03:11:19","modified_gmt":"2010-12-26T08:11:19","slug":"from-zero-to-rails-2","status":"publish","type":"post","link":"https:\/\/wcarss.ca\/log\/2010\/12\/from-zero-to-rails-2\/","title":{"rendered":"From Zero to Rails: Clean Maverick Meerkat install to working Rails app &#8211; Part 2"},"content":{"rendered":"<p>Last time (and by last time, I mean earlier this evening), I wrote out a skeletal plan for how to install ruby and rails properly on a fresh 10.10 machine. I hadn&#8217;t yet tried the instructions, only gathered them from various blogs and searches &#8211; here is, step by step, the results of applying the instructions I wrote down earlier. I&#8217;ve taken the philosophy that seeing the actual content from the terminal is generally useful, so it&#8217;s all here, with explanations when things have gone wrong. The idea is that, next time I do this, I&#8217;ll know what the hell is going on.<\/p>\n<p>Step 1:<\/p>\n<pre>wcarss@quark:~$ sudo apt-get install curl git-core\r\n[sudo] password for wcarss:\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following extra packages will be installed:\r\n  git libcurl3 libdigest-sha1-perl liberror-perl\r\nSuggested packages:\r\n  git-doc git-arch git-cvs git-svn git-email git-daemon-run git-gui gitk\r\n  gitweb\r\nThe following NEW packages will be installed:\r\n  curl git git-core libcurl3 libdigest-sha1-perl liberror-perl\r\n0 upgraded, 6 newly installed, 0 to remove and 3 not upgraded.\r\nNeed to get 6,856kB of archives.\r\nAfter this operation, 14.2MB of additional disk space will be used.\r\nDo you want to continue [Y\/n]?<\/pre>\n<p>That went well!<br \/>\nStep 2:<\/p>\n<pre>wcarss@quark:~$ bash < <( curl http:\/\/rvm.beginrescueend.com\/releases\/rvm-install-head )\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100   986  100   986    0     0   2199      0 --:--:-- --:--:-- --:--:--  7825\r\nInitialized empty Git repository in \/home\/wcarss\/.rvm\/src\/rvm\/.git\/\r\nremote: Counting objects: 16345, done.\r\nremote: Compressing objects: 100% (4267\/4267), done.\r\nremote: Total 16345 (delta 11025), reused 15855 (delta 10649)\r\nReceiving objects: 100% (16345\/16345), 2.92 MiB | 2.02 MiB\/s, done.\r\nResolving deltas: 100% (11025\/11025), done.\r\n\r\n  RVM:  Shell scripts enabling management of multiple ruby environments.\r\n  RTFM: http:\/\/rvm.beginrescueend.com\/\r\n  HELP: http:\/\/webchat.freenode.net\/?channels=rvm (#rvm on irc.freenode.net)\r\n\r\nUpgrading the RVM installation in \/home\/wcarss\/.rvm\/\r\n    Correct permissions for base binaries in \/home\/wcarss\/.rvm\/bin...\r\n    Copying manpages into place.\r\n\r\nUpgrade Notes\r\n\r\n  * rvm_trust_rvmrcs has been changed to rvm_trust_rvmrcs_flag for consistency\r\n  * Ruby package dependency list for your OS is given by:\r\n    rvm notes\r\n  * If you encounter any issues with a ruby 'X' your best bet is to:\r\n    rvm remove X ; rvm install X\r\n  * If you wish to have the 'pretty colors' again, set in ~\/.rvmrc:\r\n    export rvm_pretty_print_flag=1\r\n  * If you see the following error message: Unknown alias name: 'default'\r\n    re-set your default ruby, this is due to a change in how default works.\r\n\r\nWARNING: You have RUBYOPT set in your current environment.\r\nThis may cause rubies to not work as you expect them to as it is not supported\r\nby all of them If errors show up, please try unsetting RUBYOPT first.\r\n\r\nUpgrade of RVM in \/home\/wcarss\/.rvm\/ is complete.\r\n\r\nwcarss,\r\n\r\nThank you very much for using RVM! I sincerely hope that RVM helps to\r\nmake your work both easier and more enjoyable.\r\n\r\nIf you have any questions, issues and\/or ideas for improvement please\r\njoin#rvm on irc.freenode.net and let me know, note you must register\r\n(http:\/\/bit.ly\/5mGjlm) and identify (\/msg nickserv <nick> <pass>) to\r\ntalk, this prevents spambots from ruining our day.\r\n\r\nMy irc nickname is 'wayneeseguin' and I hang out in #rvm typically\r\n\r\n  ~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT\r\n\r\nIf I do not respond right away, please hang around after asking your\r\nquestion, I will respond as soon as I am back.  It is best to talk in\r\n#rvm itself as then other users can help out should I be offline.\r\n\r\nBe sure to get head often as rvm development happens fast,\r\nyou can do this by running 'rvm get head' followed by 'rvm reload'\r\nor opening a new shell\r\n\r\n  w\u00e2\u00a6\u00bf\u00e2\u00bf\u00e2\u00a6\u00bft\r\n\r\n    ~ Wayne\r\n\r\nwcarss@quark:~$<\/pre>\n<p>hmmm, I&#8217;ve got a warning now that I have the environment variable RUBYOPT set; it&#8217;s set to &#8220;rubygems&#8221;, and the rvm docs recommended that I unset it. I&#8217;m going to proceed without doing so, and hopefully things are fine.<\/p>\n<p>Step 3: <\/p>\n<pre>vim .bashrc<\/pre>\n<p>huh, it already has [[ -s &#8220;$HOME\/.rvm\/scripts\/rvm&#8221; ]] &#038;&#038; source &#8220;$HOME\/.rvm\/scripts\/rvm&#8221; in it! This is pretty strange; but I&#8217;m happy. I also (fortunately) don&#8217;t have any return statements floating in my .bashrc, so I&#8217;m going to proceed to the next step.<\/p>\n<p>Edit: Here is where I must insert this. It&#8217;s a week later, about 3 AM on the day after boxing day. I&#8217;ve just been trying to use heroku, and it turns out I was lacking several things in ruby because of some small errors I made at this step. I&#8217;ve had to uninstall ruby 1.9.2, install some libs and packages, and now I&#8217;m able to reinstall 1.9.2 and proceed. The following line of sudo apt-getting is not enough; in the &#8216;rvm notes&#8217; above, they listed a bunch of things to install. I would suggest that you just do as they say, exactly. Install or update all of those packages, and that should be your step 4. Then, most of the craziness I deal with later on won&#8217;t happen to you. Good luck.<\/p>\n<p>Step 4: <\/p>\n<pre>wcarss@quark:~$ sudo apt-get install libruby1.8 zlib1g-dev libssl-dev libreadline5-dev build-essential\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nbuild-essential is already the newest version.\r\nThe following extra packages will be installed:\r\n  libncurses5-dev libreadline5\r\nThe following NEW packages will be installed:\r\n  libncurses5-dev libreadline5 libreadline5-dev libruby1.8 libssl-dev zlib1g-dev\r\n0 upgraded, 6 newly installed, 0 to remove and 3 not upgraded.\r\nNeed to get 6,170kB of archives.\r\nAfter this operation, 23.5MB of additional disk space will be used.\r\nDo you want to continue [Y\/n]?<\/pre>\n<p>Went well!<\/p>\n<p>Step 5: <\/p>\n<pre>wcarss@quark:~$ rvm install ruby-1.9.2\r\n\r\nA RVM version 1.1.6 is installed yet 1.0.14 is loaded.\r\n Please do one of the following:\r\n  * 'rvm reload'\r\n  * open a new shell\r\n  * source your shell init scriptswcarss@quark:~$<\/pre>\n<p>Whoops! I was supposed to run &#8216;source ~\/.bashrc&#8217; first &#8211; let&#8217;s do that.<\/p>\n<p>Step 5 (fo realz): <\/p>\n<pre>wcarss@quark:~$ source ~\/.bashrc\r\nwcarss@quark:~$<\/pre>\n<p>No output: means all is well!<\/p>\n<p>Step 6: <\/p>\n<pre>wcarss@quark:~$ rvm install ruby-1.9.2\r\n\r\nA RVM version 1.1.6 is installed yet 1.0.14 is loaded.\r\n Please do one of the following:\r\n  * 'rvm reload'\r\n  * open a new shell\r\n  * source your shell init scriptswcarss@quark:~$<\/pre>\n<p>Huh. I&#8217;ll try &#8216;rvm reload&#8217;, and if that doesn&#8217;t work, I&#8217;ll log out and back in.<\/p>\n<p>Step 6 Redux: <\/p>\n<pre>wcarss@quark:~$ rvm reload\r\nwcarss@quark:~$ rvm install ruby-1.9.2\r\n\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0, this may take a while depending on your cpu(s)...\r\n\r\nruby-1.9.2-p0 - #fetching\r\nruby-1.9.2-p0 - #extracted to \/home\/wcarss\/.rvm\/src\/ruby-1.9.2-p0 (already extracted)\r\nruby-1.9.2-p0 - #configuring\r\nruby-1.9.2-p0 - #compiling\r\nruby-1.9.2-p0 - #installing\r\nruby-1.9.2-p0 - updating #rubygems for \/home\/wcarss\/.rvm\/gems\/ruby-1.9.2-p0@global\r\nError running '\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/bin\/gem update --system', please read \r\n\r\n\/home\/wcarss\/.rvm\/log\/ruby-1.9.2-p0\/rubygems.update.log\r\nruby-1.9.2-p0 - updating #rubygems for \/home\/wcarss\/.rvm\/gems\/ruby-1.9.2-p0\r\nError running '\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/bin\/gem update --system', please read \r\n\r\n\/home\/wcarss\/.rvm\/log\/ruby-1.9.2-p0\/rubygems.update.log\r\nruby-1.9.2-p0 - adjusting #shebangs for (gem).\r\nruby-1.9.2-p0 - #importing default gemsets (\/home\/wcarss\/.rvm\/gemsets\/)\r\nInstall of ruby-1.9.2-p0 - #complete\r\nwcarss@quark:~$<\/pre>\n<p>Woohoo! &#8216;rvm reload&#8217; did the charm. This process took about 4-5 minutes on my 6-7 year old 2GHz AMD64. Next up: 1.8.7.<br \/>\nEditor&#8217;s note: I didn&#8217;t notice the errors the first time I went through this; some of the problems I&#8217;ve got a bit later might have been detectable here.<\/p>\n<p>Step 7: <\/p>\n<pre>wcarss@quark:~$ rvm install ruby-1.8.7\r\n\/home\/wcarss\/.rvm\/rubies\/ruby-1.8.7-p302, this may take a while depending on your cpu(s)...\r\n\r\nruby-1.8.7-p302 - #fetching\r\nruby-1.8.7-p302 - #downloading ruby-1.8.7-p302, this may take a while depending on your connection...\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100 4086k  100 4086k    0     0   282k      0  0:00:14  0:00:14 --:--:--  428k\r\nruby-1.8.7-p302 - #extracting ruby-1.8.7-p302 to \/home\/wcarss\/.rvm\/src\/ruby-1.8.7-p302\r\nruby-1.8.7-p302 - #extracted to \/home\/wcarss\/.rvm\/src\/ruby-1.8.7-p302\r\nruby-1.8.7-p302 - #configuring\r\nruby-1.8.7-p302 - #compiling\r\nruby-1.8.7-p302 - #installing\r\nruby-1.8.7-p302 - #rubygems installing to ruby-1.8.7-p302\r\nRetrieving rubygems-1.3.7\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100  284k  100  284k    0     0   217k      0  0:00:01  0:00:01 --:--:--  251k\r\nExtracting rubygems-1.3.7 ...\r\nruby-1.8.7-p302 - adjusting #shebangs for (gem).\r\nruby-1.8.7-p302 - #importing default gemsets (\/home\/wcarss\/.rvm\/gemsets\/)\r\nInstall of ruby-1.8.7-p302 - #complete\r\nwcarss@quark:~$<\/pre>\n<p>Wicked! Again, a bit over 5 minutes on my aging box. This is working well so far &#8212; *knocks on wood* &#8212; gonna set 1.9.2 to default:<\/p>\n<p>Step 8: <\/p>\n<pre>wcarss@quark:~$ rvm use ruby-1.9.2 --default\r\nUsing \/home\/wcarss\/.rvm\/gems\/ruby-1.9.2-p0\r\nwcarss@quark:~$ <\/pre>\n<p>Easy!<\/p>\n<p>Step 9: <\/p>\n<pre>wcarss@quark:~$ sudo apt-get install sqlite3 libsqlite-dev sqlite-doc sqlite3-doc\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nNote, selecting 'libsqlite0-dev' instead of 'libsqlite-dev'\r\nThe following extra packages will be installed:\r\n  libsqlite0 libsqlite0-dev sqlite\r\nThe following NEW packages will be installed:\r\n  libsqlite0 libsqlite0-dev sqlite sqlite-doc sqlite3 sqlite3-doc\r\n0 upgraded, 6 newly installed, 0 to remove and 3 not upgraded.\r\nNeed to get 3,248kB of archives.\r\nAfter this operation, 10.9MB of additional disk space will be used.\r\nDo you want to continue [Y\/n]?<\/pre>\n<p>I added a few suggested doc packages. Here comes the scary part.. adding gems.<\/p>\n<p>Step 10: <\/p>\n<pre>wcarss@quark:~$ gem install sqlite3-ruby\r\n\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/bin\/gem:4: warning: Insecure world writable dir \/home\/wcarss in \r\nPATH, mode 040733\r\nERROR:  Loading command: install (LoadError)\r\n    no such file to load -- zlib\r\nERROR:  While executing gem ... (NameError)\r\n    uninitialized constant Gem::Commands::InstallCommand<\/pre>\n<p>Ah, no! This is exactly the kind of crazy bullshit I feared. I&#8217;ll turn to the RVM <a href=\"http:\/\/rvm.beginrescueend.com\/support\/troubleshooting\/\">documentation<\/a>, they suggested tryinh (the risque) &#8216;rvm get head&#8217;<\/p>\n<pre>wcarss@quark:~$ rvm get head\r\n\r\nOriginal installed RVM version:\r\n\r\nrvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http:\/\/rvm.beginrescueend.com\/]\r\n\r\nFrom http:\/\/github.com\/wayneeseguin\/rvm\r\n * branch            master     -> FETCH_HEAD\r\nAlready up-to-date.\r\n\r\n  RVM:  Shell scripts enabling management of multiple ruby environments.\r\n  RTFM: http:\/\/rvm.beginrescueend.com\/\r\n  HELP: http:\/\/webchat.freenode.net\/?channels=rvm (#rvm on irc.freenode.net)\r\n\r\nUpgrading the RVM installation in \/home\/wcarss\/.rvm\/\r\n    Correct permissions for base binaries in \/home\/wcarss\/.rvm\/bin...\r\n    Copying manpages into place.\r\n\r\n\r\nUpgrade Notes\r\n\r\n  * rvm_trust_rvmrcs has been changed to rvm_trust_rvmrcs_flag for consistency\r\n\r\n  * Ruby package dependency list for your OS is given by:\r\n    rvm notes\r\n\r\n  * If you encounter any issues with a ruby 'X' your best bet is to:\r\n    rvm remove X ; rvm install X\r\n\r\n  * If you wish to have the 'pretty colors' again, set in ~\/.rvmrc:\r\n    export rvm_pretty_print_flag=1\r\n\r\n  * If you see the following error message: Unknown alias name: 'default'\r\n    re-set your default ruby, this is due to a change in how default works.\r\n\r\n\r\nWARNING: You have RUBYOPT set in your current environment.\r\nThis may cause rubies to not work as you expect them to as it is not supported\r\nby all of them If errors show up, please try unsetting RUBYOPT first.\r\n\r\nUpgrade of RVM in \/home\/wcarss\/.rvm\/ is complete.\r\n\r\nwcarss,\r\n\r\nThank you very much for using RVM! I sincerely hope that RVM helps to\r\nmake your work both easier and more enjoyable.\r\n\r\nIf you have any questions, issues and\/or ideas for improvement please\r\njoin#rvm on irc.freenode.net and let me know, note you must register\r\n(http:\/\/bit.ly\/5mGjlm) and identify (\/msg nickserv <nick> <pass>) to\r\ntalk, this prevents spambots from ruining our day.\r\n\r\nMy irc nickname is 'wayneeseguin' and I hang out in #rvm typically\r\n\r\n  ~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT\r\n\r\nIf I do not respond right away, please hang around after asking your\r\nquestion, I will respond as soon as I am back.  It is best to talk in\r\n#rvm itself as then other users can help out should I be offline.\r\n\r\nBe sure to get head often as rvm development happens fast,\r\nyou can do this by running 'rvm get head' followed by 'rvm reload'\r\nor opening a new shell\r\n\r\n  w\u00e2\u00a6\u00bf\u00e2\u00bf\u00e2\u00a6\u00bft\r\n\r\n    ~ Wayne\r\n\r\nInstalled RVM HEAD version:\r\n\r\nrvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http:\/\/rvm.beginrescueend.com\/]\r\nwcarss@quark:~$<\/pre>\n<p>Hmm, doesn&#8217;t seem to have done anything. But in there, it says &#8220;If you wish to install rbx and\/or Ruby 1.9 head (MRI) (eg. 1.9.2-head), then you must install and use rvm 1.8.7 first.&#8221; &#8212; so maybe we need to switch to 1.8.7 as default, run &#8216;rvm get head&#8217; there, gem install something, and then we can make 1.9.2 work? We&#8217;ll give that a try if nothing super-promising comes out of a google search. Didn&#8217;t work. Googling &#8220;ruby-1.9.2-p0\/bin\/gem:4: warning: Insecure world  writable dir&#8221;<\/p>\n<p>*time passes*<\/p>\n<p>Holy crap; it&#8217;s been a few hours but I&#8217;ve finally got the gorram thing. So, what&#8217;s wrong? Actually, two things. First off, let&#8217;s fix the &#8216;insecure directory&#8217; thing. First was that my home directory, \/home\/wcarss, is world-writable! That&#8217;s pretty scary. So I called<\/p>\n<pre>chmod go-w \/home\/wcarss<\/pre>\n<p>&#8212; this leaves the u (for user, being the owner) setting of the directory with write access, and it removes write access for members of the same groups as me, and for assorted &#8220;other&#8221; users as well. &#8216;gem -v&#8217; now just returns &#8216;1.3.7&#8217; instead of <\/p>\n<pre>\/home\/wcarss\/.rvm\/rubies\/ruby-1.8.7-p302\/bin\/gem:4: warning: Insecure world writable dir \/home\/wcarss in \r\nPATH, mode 040733\r\n1.3.7<\/pre>\n<p>Next up: problem 2. This one baffled me a bit longer. The problem arises when calling<\/p>\n<pre>gem install sqlite3-ruby<\/pre>\n<p>First, let&#8217;s clarify that we \/do not\/ want to use sudo for these gem installs. That isn&#8217;t the problem. Second, let&#8217;s clarify that whatever we&#8217;ve got set as the &#8216;default ruby&#8217; is what version of gem we&#8217;re using &#8212; so for me, it&#8217;s 1.9.2 right now. While attempting to fix this problem, I switched to 1.8.7 for a while and the command worked well enough there. In 1.9.2 though, the problem persisted. You can specify a particular version to run by saying &#8216;rvm version command&#8217;, so, &#8216;rvm 1.9.2 gem -v&#8217; will only call the 1.9.2 gem, even if you have 1.8.7 set as your default for the moment. Calling this without the version parameter, like so: &#8216;rvm gem -v&#8217; will call gem for all installed versions, for me that&#8217;s both 1.8.7 and 1.9.2, in order.<\/p>\n<p>Okay, lots of text there, so what in sam hill is wrong?<\/p>\n<p>RVM grabs a source repo of ruby and then compiles it. So, I found a <a href=\" http:\/\/rbjl.net\/20-rubybuntu-2-troubleshooting-common-ruby-ubuntu-problems\">solution<\/a> early on that matched my problem in a rough sense. It&#8217;s a fantastic collection of common ruby install issues and their fixes. It suggested that, if I&#8217;d built ruby from source, I should go and make\/make install zlib. But to my naive mind, RVM wasn&#8217;t the same as installing by source. <\/p>\n<p>Turns out, RVM <em>does<\/em> build from source, so it&#8217;s susceptible to the same issues. The fix to this stage of the problem, that will remove this:<\/p>\n<pre>ERROR:  Loading command: install (LoadError)\r\n    no such file to load -- zlib\r\nERROR:  While executing gem ... (NameError)\r\n    uninitialized constant Gem::Commands::InstallCommand<\/pre>\n<p>is to do:<\/p>\n<pre>cd ~\/.rvm\/src:\r\nsudo apt-get install zlib1g-dev\r\ncd ext\/zlib\r\nruby extconf.rb\r\nmake\r\nsudo make install<\/pre>\n<p>It worked as expected! I already had zlib1g-dev, the ruby script ran fine and generated a make file, the make file took about 15 seconds to compile the code, and sudo make install did a quick copy. Then I tried it again:<\/p>\n<pre>wcarss@quark:~$ gem install sqlite3-ruby\r\nBuilding native extensions.  This could take a while...\r\nSuccessfully installed sqlite3-ruby-1.3.2\r\n1 gem installed\r\nInstalling ri documentation for sqlite3-ruby-1.3.2...\r\nInstalling RDoc documentation for sqlite3-ruby-1.3.2...\r\nwcarss@quark:~$<\/pre>\n<p>Huzzah! Finally, we can move on and try installing rails itself &#8212; it has a bunch of dependencies that it installs alongside it, so this is where, if something goes wrong, it&#8217;s some distant, barely required gem whose documentation will go insane and cause the install process to fail, borking up the whole environment. But here&#8217;s hoping it works okay:<\/p>\n<p>Step 11: <\/p>\n<pre>wcarss@quark:~$ gem install rails\r\nSuccessfully installed activesupport-3.0.3\r\nSuccessfully installed builder-2.1.2\r\nSuccessfully installed i18n-0.5.0\r\nSuccessfully installed activemodel-3.0.3\r\nSuccessfully installed rack-1.2.1\r\nSuccessfully installed rack-test-0.5.6\r\nSuccessfully installed rack-mount-0.6.13\r\nSuccessfully installed tzinfo-0.3.23\r\nSuccessfully installed abstract-1.0.0\r\nSuccessfully installed erubis-2.6.6\r\nSuccessfully installed actionpack-3.0.3\r\nSuccessfully installed arel-2.0.6\r\nSuccessfully installed activerecord-3.0.3\r\nSuccessfully installed activeresource-3.0.3\r\nSuccessfully installed mime-types-1.16\r\nSuccessfully installed polyglot-0.3.1\r\nSuccessfully installed treetop-1.4.9\r\nSuccessfully installed mail-2.2.12\r\nSuccessfully installed actionmailer-3.0.3\r\nSuccessfully installed rake-0.8.7\r\nSuccessfully installed thor-0.14.6\r\nSuccessfully installed railties-3.0.3\r\nSuccessfully installed bundler-1.0.7\r\nSuccessfully installed rails-3.0.3\r\n24 gems installed\r\nInstalling ri documentation for activesupport-3.0.3...\r\nInstalling ri documentation for builder-2.1.2...\r\nInstalling ri documentation for i18n-0.5.0...\r\nInstalling ri documentation for activemodel-3.0.3...\r\nInstalling ri documentation for rack-1.2.1...\r\nInstalling ri documentation for rack-test-0.5.6...\r\nInstalling ri documentation for rack-mount-0.6.13...\r\nInstalling ri documentation for tzinfo-0.3.23...\r\nInstalling ri documentation for abstract-1.0.0...\r\nInstalling ri documentation for erubis-2.6.6...\r\nInstalling ri documentation for actionpack-3.0.3...\r\nInstalling ri documentation for arel-2.0.6...\r\nInstalling ri documentation for activerecord-3.0.3...\r\nInstalling ri documentation for activeresource-3.0.3...\r\nInstalling ri documentation for mime-types-1.16...\r\nInstalling ri documentation for polyglot-0.3.1...\r\nInstalling ri documentation for treetop-1.4.9...\r\nInstalling ri documentation for mail-2.2.12...\r\nInstalling ri documentation for actionmailer-3.0.3...\r\nInstalling ri documentation for rake-0.8.7...\r\nInstalling ri documentation for thor-0.14.6...\r\nInstalling ri documentation for railties-3.0.3...\r\nInstalling ri documentation for bundler-1.0.7...\r\nInstalling ri documentation for rails-3.0.3...\r\nInstalling RDoc documentation for activesupport-3.0.3...\r\nInstalling RDoc documentation for builder-2.1.2...\r\nInstalling RDoc documentation for i18n-0.5.0...\r\nInstalling RDoc documentation for activemodel-3.0.3...\r\nInstalling RDoc documentation for rack-1.2.1...\r\nInstalling RDoc documentation for rack-test-0.5.6...\r\nInstalling RDoc documentation for rack-mount-0.6.13...\r\nInstalling RDoc documentation for tzinfo-0.3.23...\r\nInstalling RDoc documentation for abstract-1.0.0...\r\nInstalling RDoc documentation for erubis-2.6.6...\r\nInstalling RDoc documentation for actionpack-3.0.3...\r\nInstalling RDoc documentation for arel-2.0.6...\r\nInstalling RDoc documentation for activerecord-3.0.3...\r\nInstalling RDoc documentation for activeresource-3.0.3...\r\nInstalling RDoc documentation for mime-types-1.16...\r\nInstalling RDoc documentation for polyglot-0.3.1...\r\nInstalling RDoc documentation for treetop-1.4.9...\r\nInstalling RDoc documentation for mail-2.2.12...\r\nInstalling RDoc documentation for actionmailer-3.0.3...\r\nInstalling RDoc documentation for rake-0.8.7...\r\nInstalling RDoc documentation for thor-0.14.6...\r\nInstalling RDoc documentation for railties-3.0.3...\r\nInstalling RDoc documentation for bundler-1.0.7...\r\nInstalling RDoc documentation for rails-3.0.3...<\/pre>\n<p>It went smoothly; I&#8217;m so proud! Next up, we&#8217;ll install mongrel&#8230;<\/p>\n<p>Step 12: <\/p>\n<pre>wcarss@quark:~$ gem install mongrel\r\nBuilding native extensions.  This could take a while...\r\nBuilding native extensions.  This could take a while...\r\nERROR:  Error installing mongrel:\r\n        ERROR: Failed to build gem native extension.\r\n\r\n\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/bin\/ruby extconf.rb\r\nchecking for main() in -lc... yes\r\ncreating Makefile\r\n\r\nmake\r\ngcc -I. -I\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/include\/ruby-1.9.1\/x86_64-linux -\r\nI\/home\/wcarss\/.rvm\/rubies\/ruby-1.9.2-p0\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/wcarss\/.rvm\/rubies\/ruby-\r\n1.9.2-p0\/include\/ruby-1.9.1 -I.   -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -\r\nWpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -fPIC  -o http11.o -c http11.c\r\nhttp11.c: In function \u00e2http_field\u00e2:\r\nhttp11.c:70: warning: format not a string literal and no format arguments\r\nhttp11.c:71: warning: format not a string literal and no format arguments\r\nhttp11.c:77: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:77: error: \u00e2struct RString\u00e2 has no member named \u00e2len\u00e2\r\nhttp11.c: In function \u00e2request_uri\u00e2:\r\nhttp11.c:102: warning: format not a string literal and no format arguments\r\nhttp11.c: In function \u00e2fragment\u00e2:\r\nhttp11.c:113: warning: format not a string literal and no format arguments\r\nhttp11.c: In function \u00e2request_path\u00e2:\r\nhttp11.c:124: warning: format not a string literal and no format arguments\r\nhttp11.c: In function \u00e2query_string\u00e2:\r\nhttp11.c:135: warning: format not a string literal and no format arguments\r\nhttp11.c: In function \u00e2header_done\u00e2:\r\nhttp11.c:172: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:172: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:172: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:174: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:176: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:177: error: \u00e2struct RString\u00e2 has no member named \u00e2len\u00e2\r\nhttp11.c: In function \u00e2HttpParser_execute\u00e2:\r\nhttp11.c:298: error: \u00e2struct RString\u00e2 has no member named \u00e2ptr\u00e2\r\nhttp11.c:299: error: \u00e2struct RString\u00e2 has no member named \u00e2len\u00e2\r\nhttp11.c:307: warning: format not a string literal and no format arguments\r\nmake: *** [http11.o] Error 1\r\n\r\nGem files will remain installed in \/home\/wcarss\/.rvm\/gems\/ruby-1.9.2-p0\/gems\/mongrel-1.1.5 for inspection.\r\nResults logged to \/home\/wcarss\/.rvm\/gems\/ruby-1.9.2-p0\/gems\/mongrel-1.1.5\/ext\/http11\/gem_make.out\r\nwcarss@quark:~$<\/pre>\n<p>Nooooooo! All I wanted to do was install mongrel! Let&#8217;s figure out what&#8217;s going on here.<\/p>\n<p>*time passes*<\/p>\n<p>Haha, okay. So, it looks like someone upstream buggered mongrel up a bit and left a bunch of &#8220;RSTRING(data)->ptr&#8221; patterns around when they should have been written as &#8220;RSTRING_PTR(data)&#8221;. There&#8217;s also some malformed case statements. If you go into ~\/.rvm\/gems\/ruby-1.9.2-p0\/gems\/mongrel-1.1.5\/ext\/http11, you&#8217;ll see our culprit, http11.c. A full explanation of the fix we want can be found <a href=\"http:\/\/assorted-experience.blogspot.com\/2009\/07\/installing-mongrel-on-mac-os-x-with.html\">here<\/a> &#8211; with a few small edits.<br \/>\nI don&#8217;t think the sudo&#8217;s are a good idea for us; they&#8217;re just there in case you&#8217;re working in a system directory. Given that our whole install has proceeded through RVM, which should be inside of your home directory, we&#8217;re fine without it. I followed the form on &#8216;sudo make install&#8217; though, as it feels like a good idea to install things as root. Beyond that, it seemed prudent to run &#8216;ruby setup.rb&#8217; from within the mongrel-1.1.5 directory, just to make sure that things close off right. So, in succinct form (I&#8217;m overlapping with the website I linked here):<\/p>\n<pre>cd ~\/.rvm\/gems\/ruby-1.9.2-p0\/gems\/mongrel-1.1.5\/ext\/http11\r\nvim http11.c (generally, \"RSTRING(data)->thing\" becomes \"RSTRING_THING(data)\")\r\nmake the edits suggested at the other site\r\ncd ..\/..\/lib\/mongrel\r\nvim handlers.rb\r\nfix the case statements from 208-212 (replace ':' with 'then')\r\ngem install gem_plugin (we're avoiding sudo)\r\ncd ..\/..\/\r\nruby setup.rb<\/pre>\n<p>And you&#8217;re done. Now, let&#8217;s test this out. It&#8217;s been a bit over 4 hours since I started working on this, so&#8230; high hopes. \ud83d\ude42<\/p>\n<p>Step 13 (ominous!): <\/p>\n<pre>rails new example\r\ncd example\/\r\nbundle install\r\nrake db:create\r\nrails s<\/pre>\n<p>&#8216;new example&#8217; makes a folder called &#8216;example&#8217; for you, so don&#8217;t worry about polluting your space. &#8216;bundle install&#8217; seems to.. do some kind of magic with gems? I&#8217;m not sure. And rake db:create told me that my database already exists:<\/p>\n<pre>wcarss@quark:~\/code\/ruby\/testing\/example$ rake db:create\r\n(in \/home\/wcarss\/code\/ruby\/testing\/example)\r\ndb\/test.sqlite3 already exists\r\ndb\/development.sqlite3 already exists<\/pre>\n<p>then &#8216;rails s&#8217; starts the server, we open up a new tab, and head to servername:3000:<br \/>\nHuzzah! <\/p>\n<p>A bit over 4 hours. That&#8217;s a hell of a process to go through to get a thing running. I&#8217;m concerned that it might bork up magically in the next few months during an update (that&#8217;s what happened to my last one; ubuntu just *forgot* that ruby was installed somehow &#8212; it was fun), but at least it&#8217;s all under rvm now, and theoretically I can just remove and then reinstall a whole borked ruby environment. If things go too far astray, I can just delete all of rvm! This is the safest I&#8217;ve felt about these things in a while.<br \/>\nIf something here worked very differently for you, or you&#8217;ve got comments, certainly let me know. I can&#8217;t promise I&#8217;ll be able to fix some problem you&#8217;re running across, but I&#8217;d like to think I&#8217;d give it a try. Thanks for reading; good luck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last time (and by last time, I mean earlier this evening), I wrote out a skeletal plan for how to install ruby and rails properly on a fresh 10.10 machine. I hadn&#8217;t yet tried the instructions, only gathered them from various blogs and searches &#8211; here is, step by step, the results of applying the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/179"}],"collection":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/comments?post=179"}],"version-history":[{"count":10,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/179\/revisions"}],"predecessor-version":[{"id":181,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/posts\/179\/revisions\/181"}],"wp:attachment":[{"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/media?parent=179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/categories?post=179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wcarss.ca\/log\/wp-json\/wp\/v2\/tags?post=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}