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

Don't know how to build task 'ar:translate' (RuntimeError) #1211

Closed
hfl opened this Issue Mar 31, 2013 · 7 comments

Comments

Projects
None yet
4 participants
@hfl
Contributor

hfl commented Mar 31, 2013

When i run "padrino rake ar:translate", get errors:"Don't know how to build task 'ar:translate' (RuntimeError)"

and i run "padrino rake -T", that show me no this task. how do i translate with model?

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Apr 1, 2013

Contributor

Hey Feilong, could you post your Rakefile please? Thanks!

On Sunday, March 31, 2013, Feilong Huang wrote:

When i run "padrino rake ar:translate", get errors:"Don't know how to
build task 'ar:translate' (RuntimeError)"

and i run "padrino rake -T", that show me no this task. how i do translate
with model?


Reply to this email directly or view it on GitHubhttps://github.com/padrino/padrino-framework/issues/1211
.

Darío

Contributor

dariocravero commented Apr 1, 2013

Hey Feilong, could you post your Rakefile please? Thanks!

On Sunday, March 31, 2013, Feilong Huang wrote:

When i run "padrino rake ar:translate", get errors:"Don't know how to
build task 'ar:translate' (RuntimeError)"

and i run "padrino rake -T", that show me no this task. how i do translate
with model?


Reply to this email directly or view it on GitHubhttps://github.com/padrino/padrino-framework/issues/1211
.

Darío

@hfl

This comment has been minimized.

Show comment
Hide comment
@hfl

hfl Apr 1, 2013

Contributor

is this Rakefile?

require 'bundler/setup'
require 'padrino-core/cli/rake'

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

Contributor

hfl commented Apr 1, 2013

is this Rakefile?

require 'bundler/setup'
require 'padrino-core/cli/rake'

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

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Apr 2, 2013

Contributor

I think you spotted a bug...

You see, the translate task requires I18n to be defined, otherwise it wouldn't load it!

Since we're just loading whatever is explicitly defined in your Gemfile (require 'bundler/setup'') and not the full environment as we used to, thei18n` gem isn't there and thus the constant remains undefined!

A quick solution for you would be to explicitly do require 'i18n' on your Rakefile.

@padrino/core-members what are your thoughts on how to handle this? I'd be inclined to explicitly add the i18n gem to the Rakefile when an AR project (or any other that should be using it for their tasks definition) needs it.

Contributor

dariocravero commented Apr 2, 2013

I think you spotted a bug...

You see, the translate task requires I18n to be defined, otherwise it wouldn't load it!

Since we're just loading whatever is explicitly defined in your Gemfile (require 'bundler/setup'') and not the full environment as we used to, thei18n` gem isn't there and thus the constant remains undefined!

A quick solution for you would be to explicitly do require 'i18n' on your Rakefile.

@padrino/core-members what are your thoughts on how to handle this? I'd be inclined to explicitly add the i18n gem to the Rakefile when an AR project (or any other that should be using it for their tasks definition) needs it.

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Apr 2, 2013

Member

Since activesupport itself requires i18n I believe as does admin and helpers, we could just add it explicitly in the Rakefile in every project.

Member

nesquena commented Apr 2, 2013

Since activesupport itself requires i18n I believe as does admin and helpers, we could just add it explicitly in the Rakefile in every project.

@hfl

This comment has been minimized.

Show comment
Hide comment
@hfl

hfl Apr 3, 2013

Contributor

yes, it is right.

after add require 'i18n' in Rakefile , Padrino run correct.

thanks a lot for all.

Contributor

hfl commented Apr 3, 2013

yes, it is right.

after add require 'i18n' in Rakefile , Padrino run correct.

thanks a lot for all.

@hfl hfl closed this Apr 5, 2013

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Apr 5, 2013

Contributor

Hold on before closing it @hfi. We need to implement the fix and include i18n on the Rakefile :)

Contributor

dariocravero commented Apr 5, 2013

Hold on before closing it @hfi. We need to implement the fix and include i18n on the Rakefile :)

@dariocravero dariocravero reopened this Apr 5, 2013

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Apr 5, 2013

Member

Wouln't it be better to try to load i18n on :environment, but generate the task even if the constant is not defined?

Member

skade commented Apr 5, 2013

Wouln't it be better to try to load i18n on :environment, but generate the task even if the constant is not defined?

@nesquena nesquena closed this in 8d51bff Apr 7, 2013

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