Not able to insert value in rails console

12 views
Skip to first unread message

Sathiyaraj Gurusamy

unread,
Jan 6, 2011, 7:08:19 AM1/6/11
to rubyonra...@googlegroups.com
I am using authlogic for authentication in rails 3.0.3 with ruby 1.9.2
Using activerecord-sqlserver-adapter (3.0.5)
windows with sqlserver database

when i create user details in rails console, i am getting below error,
>User.create(:login=>'test',:password=>'test123',:password_confirmation=>'test123')
ActiveRecord::StatementInvalid: ODBC::Error: 37000 (102)
[Microsoft][ODBC SQL Se
rver Driver][SQL Server]Incorrect syntax near 'LIMIT'.: SELECT
[users].[id] FROM
[users] WHERE (LOWER([users].[login]) = LOWER(N'test')) LIMIT 1
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/connection_adapters/abstract_adapter.rb:202:in `rescue in log'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/connection_adapters/abstract_adapter.rb:194:in `log'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.0
.5/lib/active_record/connection_adapters/sqlserver/database_statements.rb:249:in
`raw_select'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.0
.5/lib/active_record/connection_adapters/sqlserver/database_statements.rb:193:in
`select'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/connection_adapters/abstract/database_statements.rb:7:in `select_all'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/connection_adapters/abstract/query_cache.rb:56:in `select_all'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/base.rb:467:in `find_by_sql'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/relation.rb:64:in `to_a'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/relation/finder_methods.rb:333:in `find_first'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/relation/finder_methods.rb:122:in `first'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/relation/finder_methods.rb:180:in `exists?'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_reco
rd/validations/uniqueness.rb:39:in `validate_each'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model
/validator.rb:154:in `block in validate'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model
/validator.rb:151:in `each'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activemodel-3.0.3/lib/active_model
/validator.rb:151:in `validate'
from
c:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_sup
port/callbacks.rb:314:in `_callback_before_85'

--
Posted via http://www.ruby-forum.com/.

Rajarshi

unread,
Jan 6, 2011, 7:32:04 AM1/6/11
to rubyonra...@googlegroups.com

I think this is for your sql server adapter configuration
check it



--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Alpha Blue

unread,
Jan 6, 2011, 8:49:30 AM1/6/11
to rubyonra...@googlegroups.com

Sathiyaraj Gurusamy

unread,
Jan 7, 2011, 1:02:59 AM1/7/11
to rubyonra...@googlegroups.com
Alpha Blue wrote in post #972808:


Yes. You are correct.. How i am rectify this error?.. Any idea??

Colin Law

unread,
Jan 7, 2011, 4:56:53 AM1/7/11
to rubyonra...@googlegroups.com
On 7 January 2011 06:02, Sathiyaraj Gurusamy <li...@ruby-forum.com> wrote:
> Alpha Blue wrote in post #972808:
>> More than likely related to this issue:
>>
>>
> https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/closed/#issue/69
>
>
> Yes. You are correct.. How i am rectify this error?.. Any idea??

The details in the link seem quite clear. Go back to Rails 3.0.1 for
the moment until the work is complete for 3.0.3. The latest comment
in the link (dated 10 hours ago as I write) states that work has
started on it.

Colin

Reply all
Reply to author
Forward
0 new messages