Skip to content
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

uninitialized constant Encoding::US_ASCII #178

Closed
calebperkins opened this issue Jun 15, 2011 · 5 comments
Closed

uninitialized constant Encoding::US_ASCII #178

calebperkins opened this issue Jun 15, 2011 · 5 comments

Comments

@calebperkins
Copy link

I started getting this upon upgrading from Rails 3.0.9 from Rails 3.0.7. However, even after I downgraded, I still this get this message. I also tried using MySQL2 version 0.2.7, but that didn't work either. What could be wrong?

rake db:migrate --trace
rake aborted!
uninitialized constant Encoding::US_ASCII
/home/deploy/staging2/shared/bundle/ruby/1.8/gems/mysql2-0.2.8/lib/mysql2/client.rb:54
/home/deploy/staging2/shared/bundle/ruby/1.8/gems/mysql2-0.2.8/lib/mysql2.rb:9
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
/home/deploy/staging2/releases/20110615012001/config/application.rb:7
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/deploy/staging2/releases/20110615012001/Rakefile:4
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
@brianmario
Copy link
Owner

What version of ruby are you using? Also, do you happen to have a class named Encoding in your application?

@calebperkins
Copy link
Author

No, I do not have an Encoding class. I am using

ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
, but I also tried with the latest Ruby Enterprise Edition and had the same problem.

@brianmario
Copy link
Owner

The offending line is here: https://github.com/brianmario/mysql2/blob/master/lib/mysql2/client.rb#L54

But you should only be getting there if there is a constant named Encoding defined: https://github.com/brianmario/mysql2/blob/master/lib/mysql2/client.rb#L51

Are you sure there isn't one in your app?

@calebperkins
Copy link
Author

Got it! I had upgraded spectator-validates_email gem from version 0.0.4 to version 0.0.6. After downgrading the migration was able to run. It's a problem with how that gem uses the Encoding class. Thank you for helping me.

@brianmario
Copy link
Owner

no problem, let me know if you run into anything else :)

On Jun 14, 2011, at 7:03 PM, rofflebuster
[email protected]
wrote:

Got it! I had upgraded spectator-validates_email gem from version 0.0.4 to version 0.0.6. After downgrading the migration was able to run. It's a problem with how that gem uses the Encoding class. Thank you for helping me.

Reply to this email directly or view it on GitHub:
#178 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants