Re: Problems with sqlite3 and JRuby

2013-08-12 Thread låzaro
try:

module Nuts::Models

   # you JDB connection here
   DB=Sequel.connect "fulanito_connection"

   class Table < Sequel::Model(:table_name)
   end

end


Or use something AR related, it do not must raise any error. For example,
do not use the 

"< V 1.2" schema...



As long you dont say "Base" in anywhere, campign will not, call their AR
weird DB backend core. and do ont include Moldes in the controller (do no
use include sentence inside the Controllers module)

Main developer say, that "Models" is an empty Module, as long you no call
"Base" in any place...



Thread name: "Re: Problems with sqlite3 and JRuby" 
Mail number: 1 
Date: Mon, Aug 12, 2013 
In reply to: Thomas Seliger 
>
> I got further yesterday by patching camping so that it uses jdbcsqlite3.
> But I encountered another problem, which was Jruby+activerecord related.
> 
> It worked with native ruby but with Jruby I always got:
> 
>   Nuts::Models is not missing constant Base!
> 
>   Ruby
> /home/tom/.rbenv/versions/jruby-1.7.4/gemsets/ugcmanager/gems/activesupport-
>   4.0.0/lib/active_support/dependencies.rb: in load_missing_constant,
> line 448
> 
> I already thought about ditching AR for sequel, is there an easy (maybe
> someone did it already) way to replace AR with sequel in camping? I
> would like to retain the nice camping model features like db migration.
> 
> Anway thanks for the reply!
> Tom
> 
> 
> Am 12.08.2013 16:54, schrieb låzaro:
> > I suggest you to use sequel instead AR. The AR's support is patethic just
> > rigth now, due the Rails's changes.
> > 
> > http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
> > 
> > 
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Problems with sqlite3 and JRuby

2013-08-12 Thread Thomas Seliger
I got further yesterday by patching camping so that it uses jdbcsqlite3.
But I encountered another problem, which was Jruby+activerecord related.

It worked with native ruby but with Jruby I always got:

  Nuts::Models is not missing constant Base!

  Ruby
/home/tom/.rbenv/versions/jruby-1.7.4/gemsets/ugcmanager/gems/activesupport-
  4.0.0/lib/active_support/dependencies.rb: in load_missing_constant,
line 448

I already thought about ditching AR for sequel, is there an easy (maybe
someone did it already) way to replace AR with sequel in camping? I
would like to retain the nice camping model features like db migration.

Anway thanks for the reply!
Tom


Am 12.08.2013 16:54, schrieb låzaro:
> I suggest you to use sequel instead AR. The AR's support is patethic just
> rigth now, due the Rails's changes.
> 
> http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
> 
> 

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Problems with sqlite3 and JRuby

2013-08-12 Thread låzaro
I suggest you to use sequel instead AR. The AR's support is patethic just
rigth now, due the Rails's changes.

http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html


Thread name: "Problems with sqlite3 and JRuby" 
Mail number: 1 
Date: Sun, Aug 11, 2013 
In reply to: Thomas Seliger 
>
> Hello,
> 
> I am new to camping and I really like the zen of this framework. I would
> like to use it with Jruby and followed the instructions at
> http://camping.io/Camping-in-jRuby
> 
> But I am unsure, where I should put
> 
>   ActiveRecord::Base.establish_connection(
> :adapter => 'jdbcsqlite3',
> :database => "foo.sqlite3"
>   )
> 
> in the code.
> 
> I am doing my experiments with the simple example from the camping book,
> but I always get:
> 
>   Gem::LoadError at /
>   Specified 'sqlite3' for database adapter, but the gem is not loaded.
>   Add `gem 'sqlite3'` to your Gemfile.
> 
> No matter what I do, camping runs this part in lib/camping/server.rb
>   
> if !Camping::Models.autoload?(:Base) && options[:database]
>   Camping::Models::Base.establish_connection(...
> :adapter => 'sqlite3',
> :database => options[:database]
>   )
> end
> 
> Maybe you could point me into the right direction, I think that I am
> doing something wrong here.
> 
> Thanks!
> Tom
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Problems with sqlite3 and JRuby

2013-08-11 Thread Thomas Seliger
Hello,

I am new to camping and I really like the zen of this framework. I would
like to use it with Jruby and followed the instructions at
http://camping.io/Camping-in-jRuby

But I am unsure, where I should put

  ActiveRecord::Base.establish_connection(
:adapter => 'jdbcsqlite3',
:database => "foo.sqlite3"
  )

in the code.

I am doing my experiments with the simple example from the camping book,
but I always get:

  Gem::LoadError at /
  Specified 'sqlite3' for database adapter, but the gem is not loaded.
  Add `gem 'sqlite3'` to your Gemfile.

No matter what I do, camping runs this part in lib/camping/server.rb

if !Camping::Models.autoload?(:Base) && options[:database]
  Camping::Models::Base.establish_connection(...
:adapter => 'sqlite3',
:database => options[:database]
  )
end

Maybe you could point me into the right direction, I think that I am
doing something wrong here.

Thanks!
Tom
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list