Newwer to Ironruby/ruby

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

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
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, but the
instructions need to be flushed out more. Will be great if you can help
flush this out…

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: [email protected]
[[email protected]] on behalf of Shri B.
[[email protected]]
Sent: Sunday, January 03, 2010 11:03 PM
To: [email protected]
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
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, but the
instructions need to be flushed out more. Will be great if you can help
flush this out…

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
Google Wave: [email protected]
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)

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
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, 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

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

I noticed your update to:
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.

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: [email protected]
[[email protected]] on behalf of Shri B.
[[email protected]]
Sent: Sunday, January 03, 2010 11:03 PM
To: [email protected]
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
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, 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

Jimmy S. wrote:

I noticed your update to:
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 ,
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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs