Hi guys, do you have any experience with different works of ruby interpreter. I''m developing intranet in this enviroment: win2000 pro, ruby 1.8.2, webrich 1.3.1 when I uploaded this files into linux env., some of the controllers began throw errors. do you have any clues, what can be the reason of this different behavior ot he same ruby interpreter on different os platform..?
It depends if you''re uploading any files with a shebang (#!) line. The autogenerated ones on windows have (on my system): #!c:/ruby/bin/ruby while on my Debian Linux install, they have: #!/usr/bin/ruby1.8 Might not be the whole story, but it''s something to check... -- Alex milos kelemen wrote:> Hi guys, > > do you have any experience with different works of ruby interpreter. > > I''m developing intranet in this enviroment: > win2000 pro, ruby 1.8.2, webrich 1.3.1 > > when I uploaded this files into linux env., some of the controllers > began throw errors. > > do you have any clues, what can be the reason of this different > behavior ot he same ruby interpreter on different os platform..? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
my dispatch.fcgi begins with #!/usr/bin/ruby (while on linux), #!c:/ruby/bin/ruby (under win) My first problem was: i have stored INT(1) in my table.attribute. It''s a checkbox on my view, so it can be 0 or 1. on my WINDOWS platform I have condition: <% if @table.attribute == 1 %> checkbox is checked <% end %> <%= @table.attribute%> // this gives me 0/1 it works fine. When I uploaded it on linux, the condition didn''t work. I found out that the value of attribute is under linux true or false, under win 0,1. (the database value is 0,1) LINUX so I had to rewrite to this: <% if @table.attribute? %> some code <% end %> <%= @table.attribute%> // this gives me true/false weird huh.. Alex Young wrote:> It depends if you''re uploading any files with a shebang (#!) line. The > autogenerated ones on windows have (on my system): > > #!c:/ruby/bin/ruby > > while on my Debian Linux install, they have: > > #!/usr/bin/ruby1.8 > > Might not be the whole story, but it''s something to check... >
That''s fun. Kudos for figuring it out... What DBs are you using on each platform? -- Alex milos kelemen wrote:> my dispatch.fcgi begins with #!/usr/bin/ruby (while on linux), > #!c:/ruby/bin/ruby (under win) > > My first problem was: > i have stored INT(1) in my table.attribute. It''s a checkbox on my view, > so it can be 0 or 1. > > on my WINDOWS platform I have condition: > <% if @table.attribute == 1 %> > checkbox is checked > <% end %> > <%= @table.attribute%> // this gives me 0/1 > it works fine. > > When I uploaded it on linux, the condition didn''t work. I found out that > the value of attribute is under linux true or false, under win 0,1. (the > database value is 0,1) > > LINUX > so I had to rewrite to this: > <% if @table.attribute? %> > some code > <% end %> > > <%= @table.attribute%> // this gives me true/false > > weird huh.. > > > Alex Young wrote: > >> It depends if you''re uploading any files with a shebang (#!) line. The >> autogenerated ones on windows have (on my system): >> >> #!c:/ruby/bin/ruby >> >> while on my Debian Linux install, they have: >> >> #!/usr/bin/ruby1.8 >> >> Might not be the whole story, but it''s something to check... >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
mysql on both sides, there are no constraints for this parameter in DB modul.. weird huh... Alex Young wrote:> That''s fun. Kudos for figuring it out... What DBs are you using on > each platform? >
milos kelemen wrote:> mysql on both sides,Which versions? And which ruby libs are accessing them? I have a sneaking suspicion that the ruby DB wrapper is doing a different type conversion on the two platforms, but I don''t know where that might be found... -- Alex
On 10-okt-2005, at 11:57, milos kelemen wrote:> > When I uploaded it on linux, the condition didn''t work. I found out > that the value of attribute is under linux true or false, under win > 0,1. (the database value is 0,1)Check which database drivers you are using on both platforms. It is possible that you are using a ruby driver on Windows and a binary driver on Linux (or the reverse), which in turn gives you different typecasting. Make sure that you use a binary driver on both (on Windows this will likely mean copying some wicked DLLs back and forth). -- Julian "Julik" Tarkhanov
Alex, sorry for late response...I was sich... :) The problem I was describimg, causes the type of attribute in MySQL DB. I mistakenly said I''d used INT, however the correct attribute type was TINYINT. and this tinyint type is causing problem... Alex Young wrote:> That''s fun. Kudos for figuring it out... What DBs are you using on > each platform? >