[MacRuby-devel] MacRuby tutorial

Laurent Sansonetti lsansonetti at apple.com
Thu Sep 25 23:50:57 PDT 2008


On Sep 25, 2008, at 11:44 AM, Raimon Fernandez wrote:

> Hi,
>
> On 25/09/2008, at 20:01, Laurent Sansonetti wrote:
>
>> Hi,
>>
>> On Sep 25, 2008, at 2:02 AM, Raimon Fernandez wrote:
>>
>>> Hello,
>>>
>>> I'm trying the MacRubyTutorial, I'm following very detail, but the
>>> result is not the expected, I can see the window, but when I click  
>>> on
>>> the button, nothing happens.
>>>
>>> I'm sure that I did all, but it's not working ...
>>>
>>> Any idea ?
>>>
>>> Do you know where I can obtain more MacRuby tutorials ?
>>
>> FYI, a new MacRuby tutorial in being written at the moment and we
>> expect to publish it very soon.
>
> Great !
>
> An EDT ?

No EDT can be given, but it should appear in the very near future  
(next week perhaps, otherwise the next one).

> It would be helpful if there are some examples about using it with a
> database (sqlite,postgresql,...)

I did not check that these database extensions were working under  
MacRuby yet. You can try if you want by your own and report any  
problem on the tracker.

> I'm having problems using the require command, in the irb it works:
>
> MacBook-Pro-Rai:~ rai$ irb
>>> require 'sqlite3'
> => true
>>> db = SQLite3::Database.new("pepe.db")
> => #<SQLite3::Database:0x52cec0 @translator=nil,
> @type_translation=false, @results_as_hash=false,
> @driver=#<SQLite3::Driver::Native::Driver:0x523c30 @trace={},
> @busy_handler={}, @authorizer={}, @callback_data={}>,
> @transaction_active=false, @statement_factory=SQLite3::Statement,
> @closed=false, @handle=#<SWIG::TYPE_p_sqlite3:0x523ba4>>

It looks like you're using the standard Ruby's irb here, not MacRuby's.

I tried to install the sqlite3-ruby gem in my environment and it  
failed [1]. I even wonder if macgem can build gems with C extensions,  
that might simply be the problem here. One could try to download the  
extension and install it manually, though.

Laurent

[1]  $ sudo macgem install sqlite3-ruby
2008-09-25 23:47:23.914 macruby[3872:a0b] *** +[RFC2253DN  
module_function]: unrecognized selector sent to class 0x93124d0
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
	ERROR: Failed to build gem native extension.

/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/bin/macruby  
extconf.rb install sqlite3-ruby
checking for fdatasync() in -lrt... no
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no

make
make: *** No rule to make target `ruby.h', needed by  
`sqlite3_api_wrap.o'.  Stop.


Gem files will remain installed in /Library/Frameworks/ 
MacRuby.framework/Versions/0.4/usr/lib/ruby/Gems/1.9.0/gems/sqlite3- 
ruby-1.2.4 for inspection.
Results logged to /Library/Frameworks/MacRuby.framework/Versions/0.4/ 
usr/lib/ruby/Gems/1.9.0/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/ 
gem_make.out



More information about the MacRuby-devel mailing list