db:create with ActiveRecord gives "uninitialized constant User::DataMapper - (NameError)"

46 views
Skip to first unread message

Arun

unread,
Nov 12, 2008, 7:56:39 PM11/12/08
to merb
Created a template Merb app, changed the ORM to activerecord in config/
init.rb, commented DM in config/dependencies.rb, generated a Model as:

jruby -S merb-gen model --orm activerecord Runner
distance:float,minutes:integer

Finally creating the database using "rake db:create" gives the
following error:

~ It took: 0
~ Loading: Merb::BootLoader::MixinSession
~ It took: 0
~ Loading: Merb::BootLoader::BeforeAppLoads
~ It took: 0
~ Loading: Merb::Orms::ActiveRecord::Connect
~ Connecting to database...
~ It took: 0
~ Loading: Merb::Slices::Loader
~ Loaded slice 'MerbAuthSlicePassword' ...
~ It took: 1
~ Loading: Merb::BootLoader::LoadClasses
~ Could not load /Users/arungupta/samples/jruby/merb/jruby-1.1.5/
samples/merb/hello/app/models/user.rb:

uninitialized constant User::DataMapper - (NameError)

This is all using JRuby 1.1.5.

What's missing ?

-Arun

Matt Aimonetti

unread,
Nov 12, 2008, 8:00:53 PM11/12/08
to me...@googlegroups.com
The generated merb stack app defines a DM User so it won't work for you. Please follow my last advice and create a core app if you want to use JRuby.  We need a DM adapter for JDBC but in the mean time, you can't use a merb stack app with JRuby.

-Matt

Arun

unread,
Nov 12, 2008, 8:09:52 PM11/12/08
to merb
Yep, that works!

Thanks,
-Arun

On Nov 12, 7:00 pm, "Matt Aimonetti" <mattaimone...@gmail.com> wrote:
> The generated merb stack app defines a DM User so it won't work for you.
> Please follow my last advice and create a core app if you want to use
> JRuby.  We need a DM adapter for JDBC but in the mean time, you can't use a
> merb stack app with JRuby.
>
> -Matt
>
Reply all
Reply to author
Forward
0 new messages