# Re: Running activerecord

**URL:** <https://www.ruby-forum.com/t/re-running-activerecord/135803>\
**Category:** IronRuby\
**Created:** [April 25, 2008, 3:25am UTC](https://www.ruby-forum.com/t/re-running-activerecord/135803 "2008-04-25T03:25:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Blackwell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c4cdca/32.png) [@Brian\_Blackwell](https://www.ruby-forum.com/u/Brian_Blackwell)\
**Post date:** [April 25, 2008, 3:25am UTC](https://www.ruby-forum.com/t/re-running-activerecord/135803/1 "2008-04-25T03:25:42Z")

</div>

On Fri, 18 Apr 2008 15:56:32 -0700, “John L. (IRONRUBY)”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) said:

> Thanks for doing this work, Brian! This will give me a bunch of things to  
> look at around the core libs this weekend.

Thanks John! I have encountered some further issues trying to run  
activerecord which I will detail in a moment, but firstly I’ve worked  
out what is going on with issue (9) in my previous email:

> (9) Problem with  
> activesupport-2.0.2\lib\active\_support\core\_ext\array\conversions.rb
> 
> - unknown: Cannot cast from ‘Microsoft.Scripting.SymbolId’ to  
> ‘Ruby.Builtins.Proc’  
> (ArgumentError)
> 
> - This is the offending piece of code in conversions.rb:

The & operator should call to\_proc on the object, but IronRuby is  
currently not doing so - I have filed a bug report on RubyForge.  
Symbol.to\_proc is defined in activesupport in order to support the above  
piece of syntactic sugar. “&:some\_symbol” is simply shorthand for  
“Proc.new { |a| a.some\_symbol }”, so as a temporary workaround, any such  
occurrences in activesupport can be replaced with the latter expression.

Here are some new issues that I have encountered with  
activesupport/activerecord:

(1) Missing library stringio

- As a workaround, I copied the pure Ruby implementation from YAML  
(this should be in C:\ruby\lib\ruby\1.8\yaml\stringio.rb in the MRI  
distribution).

(2) Problem with active\_support/core\_ext/logger.rb  
:0:in `define_around_helper': wrong number or type of arguments for `module\_eval’ (ArgumentError)

- There is currently no implementation of module\_eval that accepts a  
string parameter. As a workaround, I rewrote logger.rb so that it  
passes a block to module\_eval (see attached logger.rb). John has  
mentioned that the eval methods should be coming soon, which would  
be very helpful indeed…

(3) Problem with active\_support/core\_ext/module/attr\_internal  
:0:in `main': undefined local variable or method `attr\_internal\_naming\_format=’  
for Module:Class (NoMethodError)

- The same problem as (2): activesupport defines a method  
mattr\_accessor which calls module\_eval with a string parameter. As a  
workaround, I manually defined the accessor  
attr\_internal\_naming\_format in attr\_internal.rb (see attachment)

(4) Missing method Regexp.quote

- active\_support\core\_ext\pathname.rb requires the Ruby library  
pathname, which in turn calls Regexp.quote.
- Workaround: commented out “require ‘pathname’”

(5) Problem with active\_support/core\_ext/string/iterators.rb

- Logical operators in method arguments won’t parse - the following  
line is the culprit:  
loop { yield(scanner.scan(char) || break) }

- I have filed a bug report in RubyForge. Wayne K. has confirmed  
that this is a parser bug (incorrect grammar) - see  
[http://rubyforge.org/tracker/index.php?func=detail&aid=19672&group\_id=4359&atid=16798](http://rubyforge.org/tracker/index.php?func=detail&aid=19672&group_id=4359&atid=16798)

- As a workaround, I rewrote the above line as:

- We are also missing library ‘strscan.so’ - but StringScanner is  
built into IronRuby, so as a workaround, I changed the first line to:

require ‘strscan’ unless defined?(StringScanner)

More activesupport/activerecord observations should be coming soon. I  
will add them to Wayne’s TowardsRails Wiki page at some point.

-Brian
