padrino-gen admin > Please specify generator to use

64 views
Skip to first unread message

Patrick

unread,
Apr 29, 2010, 1:01:04 PM4/29/10
to Padrino Framework
I'm trying to set up padrino on debian squeeze.
I can get a padrino app up on :3000.

My issue is that when I try to padrino-gen admin it balks as if it
doesn't know what admin is:

Please specify generator to use (project, app, mailer, controller,
model, migration)

I can't seem to track down what the issue is, but I'm guessing it
might have to do with paths? I've already had more than one issue
tracking down path errors.

I'm looking in padrino-gen-0.9.10/lib/padrino-gen/generators/cli.rb
The culprit line seems to be that for some reason generator_kind admin
isn't mapping to a class.

Any help would be appreciated.

-Patrick

Davide D'Agostino

unread,
Apr 29, 2010, 1:09:25 PM4/29/10
to pad...@googlegroups.com
Mmm, super strange.

$ padrino g project foo -d activerecord # you need a db adapter for generate the admin
$ cd foo # very important
$ padrino g admin

If you still have problems with paths try to setup an rvm http://rvm.beginrescueend.com/

/DAddYE

Patrick

unread,
Apr 29, 2010, 2:54:04 PM4/29/10
to Padrino Framework
I'm trying to use datamapper > sqlite3 for ORM. I'll give
activerecord > sqlite a spin.

On Apr 29, 12:09 pm, Davide D'Agostino <d.dagost...@lipsiasoft.com>
wrote:
> Mmm, super strange.
>
> $ padrino g project foo -d activerecord # you need a db adapter for generate the admin
> $ cd foo # very important
> $ padrino g admin
>
> If you still have problems with paths try to setup an rvmhttp://rvm.beginrescueend.com/

Patrick

unread,
Apr 29, 2010, 4:57:40 PM4/29/10
to Padrino Framework
Nope. No go. The lines immediately following the padrino-gen
statements below are from some puts I've added to cli.rb:

def setup
Padrino::Generators.load_components!
puts "ARGV: #{ARGV}"
generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if
ARGV[0].present?
puts "generator_kind: #{generator_kind}"
generator_class = Padrino::Generators.mappings[generator_kind]
puts "generator_class: #{generator_class}"
if generator_class
puts "inside of generator_class call"
args = ARGV.empty? && generator_class.require_arguments? ?
["-h"] : ARGV
generator_class.start(args)
else
puts "Please specify generator to use
(#{Padrino::Generators.mappings.keys.join(", ")})"
end
end

root@sinatra:~# padrino-gen project sample_blog -t shoulda -e haml -m
mocha -s jquery -d activerecord
/var/lib/gems/1.9.1/gems/padrino-gen-0.9.10/lib
/var/lib/gems/1.9.1/gems/padrino-core-0.9.10/lib
/root
ARGV: ["project", "sample_blog", "-t", "shoulda", "-e", "haml", "-m",
"mocha", "-s", "jquery", "-d", "activerecord"]
generator_kind: project
generator_class: Padrino::Generators::Project
inside of generator_class call
create
create config/boot.rb
create config/apps.rb
create config.ru

8<--- snip --->8

=================================================================
sample_blog is ready for development! Next, follow these steps:
=================================================================
1) cd sample_blog
2) bundle install
=================================================================

root@sinatra:~# cd sample_blog/
root@sinatra:~/sample_blog# bundle install

8<--- snip --->8

Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
root@sinatra:~/sample_blog# padrino-gen admin
/var/lib/gems/1.9.1/gems/padrino-gen-0.9.10/lib
/var/lib/gems/1.9.1/gems/padrino-core-0.9.10/lib
/root/sample_blog
=> Located unlocked Gemfile for development
ARGV: ["admin"]
generator_kind: admin
generator_class:
Please specify generator to use (project, app, mailer, controller,
model, migration)
root@sinatra:~/sample_blog#


Thanks for pointing out the rvms. I'll look into those as well.
-Patrick

Scott Eckenrode (sre)

unread,
Apr 29, 2010, 6:42:20 PM4/29/10
to Padrino Framework
Patrick,
Check you gem directory ((looks lie maybe /var/lib/gems/1.9.1/gems)
and see if you have padrino-admin installed along with padrino-core,
padrino-cache, padrino-mailer, padrino-helpers and padrino ... on my
system at least those directories are present ... not sure if they're
not there what might have gone wrong, but not having padrino-admin
directory in your gem tree would i suspect cause the issue you're
seeing .... if it's not there, might try manual gem install (instead
of just the bundler approach) and see if that doesn't get you around
the problem for now ... just a thought from a fellow user.

Cheers
Scott

Nathan

unread,
Apr 29, 2010, 6:52:20 PM4/29/10
to Padrino Framework
Yes to me it looks like the padrino-admin gem is either not installed
or is not being loaded somehow within padrino-gen. The admin
generators are registered by the padrino-admin gem if its required.
This should (and is) happening in most cases because I have tested
padrino in 1.8.6, 1.8.7, 1.9.1, and 1.9.2 and I always see the admin
generator available once padrino-admin is installed. I am curious as
to why in this case that does not appear to be working...

On Apr 29, 3:42 pm, "Scott Eckenrode (sre)" <sc...@selectport.com>
wrote:

Dominic W

unread,
Apr 30, 2010, 5:30:25 AM4/30/10
to pad...@googlegroups.com
I have the same problem here. Gems are installed properly but I can't use "padrino g admin"

~/Development/foo$ padrino g admin

=> Located unlocked Gemfile for development
Please specify generator to use (project, app, mailer, controller, model, migration)

Tell me when you need more information on the environment.

DAddYE

unread,
Apr 30, 2010, 5:36:45 AM4/30/10
to Padrino Framework
Can you gist me your OS/Version and your Gem Env ($gem env)

Thanks so much!

Dominic W

unread,
Apr 30, 2010, 6:11:49 AM4/30/10
to pad...@googlegroups.com
Here is the gist: http://gist.github.com/385030

2010/4/30 DAddYE <d.dag...@lipsiasoft.com>

Davide D'Agostino

unread,
Apr 30, 2010, 6:36:04 AM4/30/10
to pad...@googlegroups.com
Thanks so much,

on my fedora Im not able to reproduce yours problems, I will try with ubuntu.

Thanks!

Patrick

unread,
Apr 30, 2010, 9:23:55 AM4/30/10
to Padrino Framework
No change.
-Patrick

On Apr 29, 5:42 pm, "Scott Eckenrode (sre)" <sc...@selectport.com>
wrote:

Patrick

unread,
Apr 30, 2010, 9:24:20 AM4/30/10
to Padrino Framework

DAddYE

unread,
Apr 30, 2010, 1:00:58 PM4/30/10
to Padrino Framework
Okey guys, I think there is something with Ubuntu.

After setup my ruby env I got the same error:

> Please specify generator to use (project, app, mailer, controller,
> model, migration)

Then I installed all gems for run test and now works correctly.

I think is not a problem of a missing dependency but a problem with
openssl so try this:

sudo apt-get install libssl
sudo apt-get install libssl-dev
sudo apt-get install libopenssl-ruby

If that dint work try to install these gems:

sdoc jeweler sinatra i18n usher thor bundler activesupport shoulda
mocha rack-test webrat haml fakeweb tmail builder datamapper
data_objects do_sqlite3 mai

And tell me what's happen.

Thanks so much!

DAddYE

unread,
Apr 30, 2010, 1:01:58 PM4/30/10
to Padrino Framework
sorry

sdoc jeweler sinatra i18n usher thor bundler activesupport shoulda
mocha rack-test webrat haml fakeweb tmail builder datamapper
data_objects do_sqlite3 mail rspec

On Apr 29, 7:01 pm, Patrick <patrick.cot...@gmail.com> wrote:

DAddYE

unread,
May 1, 2010, 7:08:08 AM5/1/10
to Padrino Framework
Hello guys, finally I made a small script for install all necessary
requirements on ubuntu.

Im not a Debian guru (Im an rhel fan :D) but works: http://gist.github.com/386246

Tell me if you have other problems.

Thanks!

On Apr 29, 7:01 pm, Patrick <patrick.cot...@gmail.com> wrote:

Patrick

unread,
May 3, 2010, 10:30:38 AM5/3/10
to Padrino Framework
I'll fire up two new vms (ubuntu 10.04 32-bit and debian squeeze 32-
bit) to test it out and will report back.

Patrick

unread,
May 3, 2010, 3:09:11 PM5/3/10
to Padrino Framework
http://gist.github.com/388462

two small changes:
cd foo after creating the project
and ar:migrate before ar:setup

Works a charm on both VMs from clean install.
Forgot to mention that my Ubuntu is the server install and squeeze is
the netinst.

SUPER! Thanks, DAddYE!
Reply all
Reply to author
Forward
0 new messages