no 'jcode' gem when running rails server
When I try to run 'rails server' it's giving me an error saying that it can't find 'jcode', and I think jcode is a default ruby lib. Do you guys have any clue as to whats going on?
/Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/gdata-1.1.1/lib/gdata.rb:21:in `require': no such file to load -- jcode (LoadError)
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/gdata-1.1.1/lib/gdata.rb:21:in `<top (required)>'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/contacts-1.2.4/lib/contacts/gmail.rb:1:in `require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/contacts-1.2.4/lib/contacts/gmail.rb:1:in `<top (required)>'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/contacts-1.2.4/lib/contacts.rb:6:in `require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/contacts-1.2.4/lib/contacts.rb:6:in `<top (required)>'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler.rb:112:in `requ开发者_高级运维ire'
from /Users/seanfchan/RubyPractice/gettingContancts/config/application.rb:7:in `<top (required)>'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/railties-3.0.1/lib/rails/commands.rb:28:in `require'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/railties-3.0.1/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap'
from /Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/railties-3.0.1/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
System: Mac OSx Snow Leopard
Ruby: RVM 1.9.2 Rails: 3.0.1 Gem: 1.3.7 trying to use 'contacts' gemThanks,
Sean ChanSounds like the library you're using wasn't updated for Ruby 1.9.
Ruby >= 1.9 doesn't have jcode, a module to handle japanese (EUC/SJIS) strings, as it supports unicode natively.
You may want to see of a newer version of the library is available, otherwise you can look at the source and find where it is requiring jcode, and replace it with
require 'jcode' if RUBY_VERSION < '1.9'
We should check the lib folder which is presented under the gdata gem file.
Add this line:
require 'jcode' if RUBY_VERSION < '1.9'
in the lib/gdata.rb
file.
Other solution, put this in your gemfile:
gem 'gdata_19', '1.1.5'
gem 'contacts', :git => 'git@github.com:eofferma/contacts.git'
精彩评论