Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 `require'
 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' gem

Thanks,
Sean Chan

like image 864
Sarindipity Avatar asked Nov 08 '10 01:11

Sarindipity


3 Answers

Sounds 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'
like image 144
Mark Thomas Avatar answered Nov 10 '22 04:11

Mark Thomas


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.

like image 34
pavithra Avatar answered Nov 10 '22 03:11

pavithra


Other solution, put this in your gemfile:

gem 'gdata_19', '1.1.5'
gem 'contacts', :git => '[email protected]:eofferma/contacts.git'
like image 39
FarKorE Avatar answered Nov 10 '22 04:11

FarKorE