# Newwer to Ironruby/ruby

**URL:** <https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006>\
**Category:** IronRuby\
**Created:** [January 3, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006 "2010-01-03T18:17:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 3, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/1 "2010-01-03T18:17:05Z")

</div>

Hey, I have a couple questions dealing with a couple modifications I did  
to eliminate errors I was receiving while using rails on IronRuby.  
First, mssql\_adapter.rb:  
In the execute method I commented out set\_identity\_insert\_on and  
set\_identity\_insert\_off. Why is the adapter turning on  
set\_identitty\_insert for columns that end in \_id? Isn’t it standard in  
rails for foreign keys to end in \_id?

Next, in rack-1.0.1\lib\rack\response.rb:  
On line 63 in the set\_cookie method, the clone method doesn’t exist.

Has anyone else experienced similar problems?  
I just commented out the set\_identity sections in execute. In  
set\_cookie, I removed clone and it seemed to work.

Does anyone have better patches or work-arounds than what I have done?

Thanks,  
Sam

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 4, 2010, 8:09am UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/2 "2010-01-04T08:09:27Z")

</div>

For SQL Server, you are better off using ironruby-dbi +  
sqlserver\_adapter as mentioned in the attached email. Ivan has already  
fixed a number of SQL issues in ironruby-dbi. Usage is not streamlined  
yet though. See  
[http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb](http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb)  
for hints on how to set things up.

I have added a rough note about this to  
[http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails), but the  
instructions need to be flushed out more. Will be great if you can help  
flush this out…

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 4, 2010, 8:20am UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/3 "2010-01-04T08:20:34Z")

</div>

Actually, I have already spent some time figuring out the correct  
instructions, but have not posted yet. I’d like as much help, so Sam,  
I’d like as much feedback as you can provide.

For SQLServer, the mssql adapter is no longer being maintained, and the  
pointers Shri gave are the preferred way of doing things. However, like  
I said, the instructions aren’t quite tested yet, so either you can  
figure it out yourself, or wait for me to update it (which will be soon,  
but again it will be good for help).

I’m not aware of your rack issue, so I’ll look into it. Is this error  
occur when running against WEBrick?

~js

* * *

From: removed\_email\_address@domain.invalid  
[removed\_email\_address@domain.invalid] on behalf of Shri B.  
[removed\_email\_address@domain.invalid]  
Sent: Sunday, January 03, 2010 11:03 PM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] Newwer to Ironruby/ruby

For SQL Server, you are better off using ironruby-dbi +  
sqlserver\_adapter as mentioned in the attached email. Ivan has already  
fixed a number of SQL issues in ironruby-dbi. Usage is not streamlined  
yet though. See  
[http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb](http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb)  
for hints on how to set things up.

I have added a rough note about this to  
[http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails), but the  
instructions need to be flushed out more. Will be great if you can help  
flush this out…

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 4, 2010, 10:45pm UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/4 "2010-01-04T22:45:07Z")

</div>

## If you need any help getting the ironruby-dbi stuff going ping this list again.

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Blog: [http://flanders.co.nz](http://flanders.co.nz)  
Google Wave: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 13, 2010, 9:03am UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/5 "2010-01-13T09:03:50Z")

</div>

Shri B. wrote:

> For SQL Server, you are better off using ironruby-dbi +  
> sqlserver\_adapter as mentioned in the attached email. Ivan has already  
> fixed a number of SQL issues in ironruby-dbi. Usage is not streamlined  
> yet though. See  
> [http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb](http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb)  
> for hints on how to set things up.
> 
> I have added a rough note about this to  
> [http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails), but the  
> instructions need to be flushed out more. Will be great if you can help  
> flush this out…

I noticed your update to:  
[http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails#database](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#database)

also, I had to add this:  
$: \<\< IRONRUBY\_DBI\_PATH  
$: \<\< SQLSERVER\_ADAPTER\_PATH  
in environment.rb as well so it would be added to the load path to get  
it to work correctly. Plus, I needed the deprecated gem which  
iroonruby-dbi requires. Might be worth mentioning that the user should  
also set their correct username and password.

Hope this helps,  
-Sam

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 13, 2010, 9:21am UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/6 "2010-01-13T09:21:23Z")

</div>

> I noticed your update to:  
> [http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails#database](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#database)
> 
> also, I had to add this:  
> $: \<\< IRONRUBY\_DBI\_PATH  
> $: \<\< SQLSERVER\_ADAPTER\_PATH  
> in environment.rb as well so it would be added to the load path to get it to  
> work correctly.

That’s what these lines are for:  
$:.unshift “#{IRONRUBY\_DBI\_PATH}/src/lib”  
$:.unshift “#{SQLSERVER\_ADAPTER\_PATH}/lib”

The code to add to environment.rb that’s in the link there is all that  
is needed.  
Adding the lines you added should have no effect, especially the first  
one  
as the correct dbi.rb won’t be found in ironruby-dbi.

> Plus, I needed the deprecated gem which irooruby-dbi requires.

Step #2 of Setup says to install the “deprecated” gem.

> Might be worth mentioning that the user should also set their  
> correct username and password.

Where? In the database.yml file, I suggested to use integrated security,  
which  
doesn’t require putting your username and password.

It’d be great to bundle all this in a ironruby-rails gem to do this  
automatically.  
Also, ironruby-dbi really should just depend on the dbi gem itself, and  
be  
renamed to ironruby-dbd, which just adds the mssql dbd extension. It  
should also  
take a dependency on the depreciated gem so it doesn’t need to be  
installed separately.

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 4, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/7 "2010-01-04T19:41:44Z")

</div>

Jimmy S. wrote:

> Actually, I have already spent some time figuring out the correct  
> instructions, but have not posted yet. I’d like as much help, so Sam,  
> I’d like as much feedback as you can provide.
> 
> For SQLServer, the mssql adapter is no longer being maintained, and the  
> pointers Shri gave are the preferred way of doing things. However, like  
> I said, the instructions aren’t quite tested yet, so either you can  
> figure it out yourself, or wait for me to update it (which will be soon,  
> but again it will be good for help).
> 
> I’m not aware of your rack issue, so I’ll look into it. Is this error  
> occur when running against WEBrick?
> 
> ~js
> 
> * * *
> 
> From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [removed\_email\_address@domain.invalid] on behalf of Shri B.  
> [removed\_email\_address@domain.invalid]  
> Sent: Sunday, January 03, 2010 11:03 PM  
> To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Subject: Re: [Ironruby-core] Newwer to Ironruby/ruby
> 
> For SQL Server, you are better off using ironruby-dbi +  
> sqlserver\_adapter as mentioned in the attached email. Ivan has already  
> fixed a number of SQL issues in ironruby-dbi. Usage is not streamlined  
> yet though. See  
> [http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb](http://github.com/ironruby/ironruby/blob/master/Merlin/Main/Languages/Ruby/Tests/Scripts/ActiveRecordTests.rb)  
> for hints on how to set things up.
> 
> I have added a rough note about this to  
> [http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails), but the  
> instructions need to be flushed out more. Will be great if you can help  
> flush this out…

Yes, I am currently running WEBrick in a development environment, but  
soon I want to deploy it in a closed network on IIS. The rack issue was  
showing up when the authlogic gem that I am using for authenication was  
trying to destroy the session. I will try to set up a environment at  
home using IronRuby, Rails, and ironruby-dbi + sqlserver. Especially  
since I have a web application I would like to develop at home. I would  
be more than happy to provide feedback of my results and any problems  
and solutions that I find.

I am very excited about the progress that you guys have made on getting  
Ruby running on .Net.

Thanks for the feedback,  
-Sam

---

<div class="post-metadata">

**Author:** ![samckayak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Post date:** [January 13, 2010, 6:36pm UTC](https://www.ruby-forum.com/t/newwer-to-ironruby-ruby/181006/8 "2010-01-13T18:36:27Z")

</div>

Jimmy S. wrote:

> > I noticed your update to:  
> > [http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails#database](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#database)
> > 
> > also, I had to add this:  
> > $: \<\< IRONRUBY\_DBI\_PATH  
> > $: \<\< SQLSERVER\_ADAPTER\_PATH  
> > in environment.rb as well so it would be added to the load path to get it to  
> > work correctly.
> 
> That’s what these lines are for:  
> $:.unshift “#{IRONRUBY\_DBI\_PATH}/src/lib”  
> $:.unshift “#{SQLSERVER\_ADAPTER\_PATH}/lib”
> 
> The code to add to environment.rb that’s in the link there is all that  
> is needed.  
> Adding the lines you added should have no effect, especially the first  
> one  
> as the correct dbi.rb won’t be found in ironruby-dbi.
> 
> > Plus, I needed the deprecated gem which irooruby-dbi requires.
> 
> Step #2 of Setup says to install the “deprecated” gem.
> 
> > Might be worth mentioning that the user should also set their  
> > correct username and password.
> 
> Where? In the database.yml file, I suggested to use integrated security,  
> which  
> doesn’t require putting your username and password.
> 
> It’d be great to bundle all this in a ironruby-rails gem to do this  
> automatically.  
> Also, ironruby-dbi really should just depend on the dbi gem itself, and  
> be  
> renamed to ironruby-dbd, which just adds the mssql dbd extension. It  
> should also  
> take a dependency on the depreciated gem so it doesn’t need to be  
> installed separately.

Sorry, your right. I copied over the lib directory of both of the  
downloads without even paying attention. Also, I didn’t re-read every  
part of [http://ironruby.net/Documentation/Real\_Ruby\_Applications/Rails](http://ironruby.net/Documentation/Real_Ruby_Applications/Rails) ,  
just the database part, so I missed the deprecated gem. I was up at  
midnight trying to get this to work…

Thanks for the help.
