ai/r18n — Issue #49: can't convert Pathname to String (TypeError)
Author: maca
Created: 2011-11-30 22:10:43+00:00
State: open

I am having this error when requiring r18n-core, strange thing is that it only occurs when I use rspec to run my spec suit and not when I require in irb.

Using a string instead of Pathname fixes the issue.

/Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1064:in `escape': can't convert Pathname to String (TypeError)
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1064:in `block in loaded_path?'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1063:in `each'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1063:in `find'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1063:in `loaded_path?'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/r18n-core-0.4.11/lib/r18n-core.rb:26:in `'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-r18n-0.4.11/lib/sinatra/r18n.rb:22:in `'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `require'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `rescue in require'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/vermelho/Code/Gems/Web/revise/lib/revise.rb:2:in `'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/Code/Gems/Web/revise/spec/spec_helper.rb:2:in `'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
from /Users/vermelho/Code/Gems/Web/revise/spec/revise_model_spec.rb:1:in `'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/vermelho/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'