Pregunta

I have upgrade rails2 to rails3 and when i try to rake db:migrate I have found following error

** Invoke db:migrate (first_time)

** Invoke environment (first_time)

** Execute environment

DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in ActiveSupport::Callbacks instead. (called from include at /home/cis/.rvm/gems/ruby-1.9.3-p392@rails3214/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:29)

** Invoke db:load_config (first_time)

** Execute db:load_config

** Execute db:migrate

rake aborted!

/home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/trace_output.rb:16:in `block in trace_on': invalid byte sequence in US-ASCII (ArgumentError)

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/trace_output.rb:14:in `map'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/trace_output.rb:14:in `trace_on'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:340:in `trace'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:187:in `display_error_message'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@rails3214/gems/airbrake-3.1.14/lib/airbrake/rake_handler.rb:23:in `display_error_message_with_airbrake'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:174:in `rescue in standard_exception_handling'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/bin/rake:19:in `load'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@global/bin/rake:19:in `<main>'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@rails3214/bin/ruby_executable_hooks:15:in `eval'

    from /home/cis/.rvm/gems/ruby-1.9.3-p392@rails3214/bin/ruby_executable_hooks:15:in `<main>'
¿Fue útil?

Solución

the error is due to non ascii characters in some of your db/migration file(s). add

#encoding: utf-8 

to the file(s) where u see strange characters

Otros consejos

It seems like an encoding error

add these below lines to environment.rb file and run migration

Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top