I am porting a Rails app that is made up of 2 rails projects to SQL Server. The app already runs with MySQL and Oracle. One Rails project is the UI with a database that contains user/project specific data. The second Rails project is the database server for the main data. The UI makes REST calls to the database to get data to display. There is a list of product lines that is used on a search screen so the user chooses which product line to search. My problem is that with SQL Server as the database, about 80% of the time an exception gets thrown after the first product line data is returned. The message from the exception is "undefined method `name'' for nil:NilClass". This problem does not happen with MySQL nor Oracle as the database. So, it appears to be something to do with the database. I am using activerecord-sqlserver-adapter with a system DSN to connect to the database. I also had to move from Ruby 1.8.7 back to 1.8.6 to get the adapter to work at all. I have seen references to using ADO or ODBC instead. So my questions are: 1. Has anybody else had a similar problem? 2. What database adapter is the proper one to use with SQL Server? Thanks in advance! Norm -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Aside from the migrations and database.yml, have you changed any other code in the app? On Apr 28, 7:10 am, Norman Smith <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am porting a Rails app that is made up of 2 rails projects to SQL > Server. The app already runs with MySQL and Oracle. One Rails project is > the UI with a database that contains user/project specific data. The > second Rails project is the database server for the main data. The UI > makes REST calls to the database to get data to display. There is a list > of product lines that is used on a search screen so the user chooses > which product line to search. My problem is that with SQL Server as the > database, about 80% of the time an exception gets thrown after the first > product line data is returned. The message from the exception is > "undefined method `name'' for nil:NilClass". > > This problem does not happen with MySQL nor Oracle as the database. So, > it appears to be something to do with the database. I am using > activerecord-sqlserver-adapter with a system DSN to connect to the > database. I also had to move from Ruby 1.8.7 back to 1.8.6 to get the > adapter to work at all. I have seen references to using ADO or ODBC > instead. > > So my questions are: > > 1. Has anybody else had a similar problem? > 2. What database adapter is the proper one to use with SQL Server? > > Thanks in advance! > Norm > -- > Posted viahttp://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
command0 wrote:> Aside from the migrations and database.yml, have you changed any other > code in the app?Nope, same code. I am truly impressed with the portability of Rails apps! I did most of my development with JRuby in Ubuntu. The other developer used Ruby/Windows. The app runs on MySQL, Oracle, and SQL server from the same code base. Unless an app does something strange, other than getting a new environment set up and tweaking the config files, is about all you have to do. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> So my questions are: > > 1. Has anybody else had a similar problem? > 2. What database adapter is the proper one to use with SQL Server? > > Thanks in advance! > NormI am using only simple access to MS SQL I also find out how to call procedures. No problems so far. ODBC is the only working way. Be it on Windows or Linux. Although it is not so trivial to install support on Linux it can be done (I am the proof ;-) Search for "ruby odbc freetds" on google. by TheR -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.