{"id":1730,"date":"2009-10-25T22:06:30","date_gmt":"2009-10-25T22:06:30","guid":{"rendered":"http:\/\/justthesam.com\/2009\/10\/rvm-and-netbeans\/"},"modified":"2009-10-25T22:06:30","modified_gmt":"2009-10-25T22:06:30","slug":"rvm-and-netbeans","status":"publish","type":"post","link":"https:\/\/justthesam.com\/?p=1730","title":{"rendered":"RVM and NetBeans"},"content":{"rendered":"<p>I&#39;ve been having a lot of trouble with my Ruby 1.9.1 install on Mac OS X. Mostly it works fine, but I struggle when installing gems that require native extensions. I think this is because the way my install was built causes linkage problems, perhaps due to 32 vs 64 bit issues, or due to linkage with other libraries. I&#39;m not entirely sure what&#39;s causing the problems, but recently I decided enough was enough and tried out <a href=\"http:\/\/rvm.beginrescueend.com\/\" target=\"_blank\" rel=\"noopener\">rvm<\/a>&#0160;since I&#39;ve heard a lot of good things about it. I got the impression that by compiling from my own source I was stubbornly making a lot of my own trouble.<\/p>\n<p>Rvm is trivial to install: it&#39;s a gem that installs some of its own executables. I did hack my PATH first, to remove&#0160;\/usr\/local\/bin (where my custom Ruby lived) so that I&#39;d be using the stock Mac OS X Ruby for the rvm install.<\/p>\n<\/p>\n<p>&gt; sudo gem install rvm<br \/>&gt; rvm-install<\/p>\n<\/p>\n<p>Note that rvm-install added the following to the end of ~\/.bash_profile automatically, so I could ignore the instruction it gave me about adding it myself:<\/p>\n<p><span style=\"font-family: Courier;\">if [ -s ~\/.rvm\/scripts\/rvm ] ; then source ~\/.rvm\/scripts\/rvm ; fi<\/span><\/p>\n<p>I then used rvm to install a fresh version of Ruby 1.9.1:<br \/>\n&gt;&gt; rvm install 1.9.1<\/p>\n<p>Actually that failed with an error about libsqlite3.dylib being the wrong architecture &#8211; perhaps another hangover from my old manual installs, or a problem I&#39;m going to have to solve sometime in the future! For now I moved the old version of that file and tried again:<\/p>\n<p>&gt; sudo mv \/usr\/local\/lib\/libsqlite3.dylib \/usr\/local\/lib\/libsqlite3.dylibOLD<br \/>&gt; rvm install 1.9.1<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica\">\n<p>And that left me with a decent ruby 1.9.1 install. Which brought me back to one of the things that I was originally frustrated by: getting NetBeans Ruby debugging working with the fast debugger. With my old install the ruby-debug-ide gem would not install, but I&#39;m pleased to report that it does with this new setup.<\/p>\n<p>However getting NetBeans to actually use my new rvm ruby required a bit of a trick. The Ruby Platform management GUI in NetBeans doesn&#39;t show you hidden folders in its file picker, so you can&#39;t navigate to the ~\/.rvm\/ruby-1.9.1-p243\/bin\/ruby file that it wants. The trick is to create a non-hidden symlink, so you can then find it from NetBeans (and it&#39;s also handy to get at your rvm files from Finder):<\/p>\n<p>&gt; ln -s ~\/.rvm ~\/rvm<\/p>\n<p>One word of warning: once you&#39;re using an RVM Ruby install, <strong>do not use sudo for gem installs<\/strong>, as the gems (and every part of rvm) live in ~\/.rvm so sudo is not required. In fact using sudo will knacker your gems quite badly as it gets its PATH wrong and its permissions and you end up deleting a bunch of stuff to get back to a known good state. I learnt this the hard way!<\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;ve been having a lot of trouble with my Ruby 1.9.1 install on Mac OS X. Mostly it works fine, but I struggle when installing gems that require native extensions. I think this is because the way my install was built causes linkage problems, perhaps due to 32 vs 64 bit issues, or due to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,22,23,33],"tags":[],"class_list":["post-1730","post","type-post","status-publish","format-standard","hentry","category-mac","category-programming","category-ruby","category-webtech"],"_links":{"self":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts\/1730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1730"}],"version-history":[{"count":0,"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts\/1730\/revisions"}],"wp:attachment":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}