<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Moves On Rails: Tag native</title>
    <link>http://www.movesonrails.com/articles/tag/native?tag=native</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>New ways to look at software</description>
    <item>
      <title>Solving some gem install problems</title>
      <description>&lt;p&gt;Lately we have been having some issues installing gem that have to compile native extensions like libxml-ruby and termios.&lt;/p&gt;

&lt;p&gt;The error we got from libxml was: "extconf failure: need libm". Strangely this was all caused by incorrect compile flags in the rbconfig.rb file.&lt;/p&gt;

&lt;p&gt;To fix this (and other issues) you can customize the rbconfig.rb file to your specific computer.&lt;/p&gt;

&lt;p&gt;Mine was located in: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt; /usr/lib/ruby/1.8/universal-darwin8.0/rbconfig.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On leopard this is universal-darwin9.0. The file contains a lot of config definitions. I removed all traces of any other architecture then i386 (like -arch x86_64, etc). I also removed the 64 flag that was included.&lt;/p&gt;

&lt;p&gt;After altering this in the entire file (quite a few replaces), everything compiled happily.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;update&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I was also having some issues with the SQLSessionStore plugin. Seems recent changes to ruby have made it a no-no to alter constants (no surprise there). So now in stead of doing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.
  update(:database_manager =&gt; SqlSessionStore)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You have to do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dso = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS
dso[:database_manager] = SqlSessionStore
ActionController::CgiRequest.send(:remove_const, "DEFAULT_SESSION_OPTIONS")
ActionController::CgiRequest.const_set("DEFAULT_SESSION_OPTIONS", dso)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which is uglier, and still should not be possible :)&lt;/p&gt;

&lt;p&gt;To make it work I also had to remove the &lt;code&gt;require 'mysql'&lt;/code&gt; line from the plugins MySqlSession.rb file. Else it would crash rails with the following error:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;warning: already initialized constant OPTIONS&lt;/code&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 29 Jul 2007 18:08:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:a95f4c46-8274-4525-a8d9-06aee7c3eed0</guid>
      <author>andre.foeken@movesonrails.com (Andre Foeken)</author>
      <link>http://www.movesonrails.com/articles/2007/07/29/solving-some-gem-install-problems</link>
      <category>Rails</category>
      <category>Ruby</category>
      <category>sqlsessionstore</category>
      <category>libxml</category>
      <category>ruby</category>
      <category>compile</category>
      <category>native</category>
      <category>libm</category>
      <category>dylib</category>
      <category>darwin8.0</category>
      <category>darwin9.0</category>
      <category>universal</category>
      <category>arch</category>
      <category>fail</category>
    </item>
  </channel>
</rss>
