New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rake tasks #1109

Closed
dariocravero opened this Issue Mar 11, 2013 · 9 comments

Comments

Projects
None yet
3 participants
@dariocravero
Contributor

dariocravero commented Mar 11, 2013

With the separation of rake tasks and the need to require them explicity, I find it a bit confusing that the following commands don't do the same:

bundle exec padrino rake ar:migrate

vs

bundle exec rake ar:migrate

If I don't bundle exec the call rake ar:migrate it fails because I'm it wouldn't load the rest of the requirements but I reckon that's fine.

Now, my question is: shouldn't the two above at least be the same?

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Mar 11, 2013

Member

Could you please show be the error that it is throwing? ar:migrate depends on enviroment, so it should actually load it.

Member

skade commented Mar 11, 2013

Could you please show be the error that it is throwing? ar:migrate depends on enviroment, so it should actually load it.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 11, 2013

Contributor
@daris.local➜  haml-app  bundle exec padrino rake ar:migrate
=> Executing Rake ar:migrate ...
Loading activerecord tasks automatically.
This functionality will be disabled in future versions. Please put

   PadrinoTasks.use(:activerecord)
   PadrinoTasks.init

and remove

   require File.expand_path('../config/boot.rb', __FILE__)

in you Rakefile instead.
Loading database tasks automatically.
This functionality will be disabled in future versions. Please put

   PadrinoTasks.use(:database)
   PadrinoTasks.init

and remove

   require File.expand_path('../config/boot.rb', __FILE__)

in you Rakefile instead.
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
   INFO -  Migrating to CreateAccounts (1)
   INFO -  Migrating to CreateTests (2)
   INFO -  Migrating to CreateTestdas (3)
  DEBUG -   (0.1ms)  select sqlite_version(*)
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
@daris.local➜  haml-app  bundle exec rake ar:migrate
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
   INFO -  Migrating to CreateAccounts (1)
   INFO -  Migrating to CreateTests (2)
   INFO -  Migrating to CreateTestdas (3)
  DEBUG -   (0.1ms)  select sqlite_version(*)
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
@daris.local➜  haml-app  rake ar:migrate
rake aborted!
undefined method `use' for PadrinoTasks:Module
/Users/daris/Documents/uxtemple/opensource/admins/haml-app/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)
@daris.local➜  haml-app
Contributor

dariocravero commented Mar 11, 2013

@daris.local➜  haml-app  bundle exec padrino rake ar:migrate
=> Executing Rake ar:migrate ...
Loading activerecord tasks automatically.
This functionality will be disabled in future versions. Please put

   PadrinoTasks.use(:activerecord)
   PadrinoTasks.init

and remove

   require File.expand_path('../config/boot.rb', __FILE__)

in you Rakefile instead.
Loading database tasks automatically.
This functionality will be disabled in future versions. Please put

   PadrinoTasks.use(:database)
   PadrinoTasks.init

and remove

   require File.expand_path('../config/boot.rb', __FILE__)

in you Rakefile instead.
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
   INFO -  Migrating to CreateAccounts (1)
   INFO -  Migrating to CreateTests (2)
   INFO -  Migrating to CreateTestdas (3)
  DEBUG -   (0.1ms)  select sqlite_version(*)
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
@daris.local➜  haml-app  bundle exec rake ar:migrate
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
   INFO -  Migrating to CreateAccounts (1)
   INFO -  Migrating to CreateTests (2)
   INFO -  Migrating to CreateTestdas (3)
  DEBUG -   (0.1ms)  select sqlite_version(*)
  DEBUG -   (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
@daris.local➜  haml-app  rake ar:migrate
rake aborted!
undefined method `use' for PadrinoTasks:Module
/Users/daris/Documents/uxtemple/opensource/admins/haml-app/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)
@daris.local➜  haml-app
@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 11, 2013

Contributor
@daris.local➜  haml-app  cat Rakefile
require 'padrino-core/cli/rake'

PadrinoTasks.use(:activerecord)
PadrinoTasks.use(:database)
PadrinoTasks.init
Contributor

dariocravero commented Mar 11, 2013

@daris.local➜  haml-app  cat Rakefile
require 'padrino-core/cli/rake'

PadrinoTasks.use(:activerecord)
PadrinoTasks.use(:database)
PadrinoTasks.init
@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 11, 2013

Contributor

On padrino rake .... it's not really an error but a warning

Contributor

dariocravero commented Mar 11, 2013

On padrino rake .... it's not really an error but a warning

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Mar 11, 2013

Member

Seems like padrino-core/cli/rake doesn't load PadrinoTasks fully :(. This is definitely a bug.

Member

skade commented Mar 11, 2013

Seems like padrino-core/cli/rake doesn't load PadrinoTasks fully :(. This is definitely a bug.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Mar 11, 2013

Contributor

I reckon we should look into it to release 0.11.0?

Contributor

dariocravero commented Mar 11, 2013

I reckon we should look into it to release 0.11.0?

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Mar 11, 2013

Member

Yes.

Member

skade commented Mar 11, 2013

Yes.

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Mar 12, 2013

Member

The first bug (bare rake) is due to rake picking up the external "padrino" that you installed as gem. Try the following:

bundle install --binstubs
bin/rake -T

Works. This will go a away in the release version.

What bothers me is that padrino rake -T warns because of autoloading.

Member

skade commented Mar 12, 2013

The first bug (bare rake) is due to rake picking up the external "padrino" that you installed as gem. Try the following:

bundle install --binstubs
bin/rake -T

Works. This will go a away in the release version.

What bothers me is that padrino rake -T warns because of autoloading.

@skade skade closed this in 2dbcc2d Mar 12, 2013

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Mar 12, 2013

Member

Nice!

Member

nesquena commented Mar 12, 2013

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment