Ruby on rails 否';jcode';运行rails服务器时的gem

Ruby on rails 否';jcode';运行rails服务器时的gem,ruby-on-rails,Ruby On Rails,当我尝试运行“rails服务器”时,它会给我一个错误,说它找不到“jcode”,我认为jcode是默认的ruby库。 你们知道发生了什么事吗 /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.

当我尝试运行“rails服务器”时,它会给我一个错误,说它找不到“jcode”,我认为jcode是默认的ruby库。 你们知道发生了什么事吗

/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>'
/Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/gdata-1.1.1/lib/gdata.rb:21:in'require':没有要加载的文件--jcode(LoadError)
from/Users/seanfchan/.rvm/gems/ruby-1.9.2-p0@global/gems/gdata-1.1.1/lib/gdata.rb:21:in`'
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`'
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`'
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层)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`'
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'
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`'
来自脚本/rails:6:in'require'
来自脚本/rails:6:in`'
系统:Mac OSx雪豹
Ruby:RVM1.9.2
Rails:3.0.1
创业板:1.3.7
尝试使用“联系人”gem

谢谢,

肖恩·陈(Sean Chan)

听起来你正在使用的库没有针对Ruby 1.9进行更新

Ruby>=1.9没有jcode,这是一个处理日语(EUC/SJIS)字符串的模块,因为它本机支持unicode

您可能希望看到有一个更新版本的库可用,否则您可以查看源代码,找到它需要jcode的地方,并将其替换为

require 'jcode' if RUBY_VERSION < '1.9'
如果RUBY_版本<'1.9',则需要'jcode'
我们应该检查gdatagem文件下的lib文件夹

添加此行:

require 'jcode' if RUBY_VERSION < '1.9'
如果RUBY_版本<'1.9',则需要'jcode'
lib/gdata.rb
文件中。

其他解决方案中,将其放入GEM文件中:

gem 'gdata_19', '1.1.5'
gem 'contacts', :git => 'git@github.com:eofferma/contacts.git'

我是ruby新手,也犯了同样的错误。你能告诉我把这个代码放在哪里的确切文件吗???@Bongs:错误消息告诉你确切的文件和行。我只需要切换到:gem'gdata_19','1.1.5'