Подтвердить что ты не робот

No 'jcode' gem при запуске сервера rails

Когда я пытаюсь запустить "сервер rails", он дает мне ошибку, говоря, что он не может найти "jcode", и я думаю, что jcode является стандартным ruby ​​lib. Вы, ребята, знаете, что происходит?

/Users/seanfchan/.rvm/gems/[email protected]/gems/gdata-1.1.1/lib/gdata.rb:21:in `require': no such file to load -- jcode (LoadError)
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/gdata-1.1.1/lib/gdata.rb:21:in `<top (required)>'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/contacts-1.2.4/lib/contacts/gmail.rb:1:in `require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/contacts-1.2.4/lib/contacts/gmail.rb:1:in `<top (required)>'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/contacts-1.2.4/lib/contacts.rb:6:in `require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/contacts-1.2.4/lib/contacts.rb:6:in `<top (required)>'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require'
 from /Users/seanfchan/.rvm/gems/[email protected]/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/[email protected]/gems/railties-3.0.1/lib/rails/commands.rb:28:in `require'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/railties-3.0.1/lib/rails/commands.rb:28:in `block in <top (required)>'
 from /Users/seanfchan/.rvm/gems/[email protected]/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap'
 from /Users/seanfchan/.rvm/gems/[email protected]/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>'

Система: Mac OSx Snow Leopard
Рубин: RVM 1.9.2
Rails: 3.0.1
Самоцвет: 1.3.7
пытаясь использовать драгоценный камень "контакты"

Спасибо,
Шон Чан

4b9b3361

Ответ 1

Похоже, что библиотека, которую вы используете, не была обновлена ​​для Ruby 1.9.

Ruby >= 1.9 не имеет jcode, модуль для обработки строк japanese (EUC/SJIS), поскольку он поддерживает нужный код изначально.

Возможно, вам захочется увидеть более новую версию библиотеки, в противном случае вы можете посмотреть на источник и найти, где он требует jcode, и заменить его на

require 'jcode' if RUBY_VERSION < '1.9'

Ответ 2

Мы должны проверить папку lib, которая представлена ​​в файле gdata gem.

Добавьте эту строку:

require 'jcode' if RUBY_VERSION < '1.9'

в файле lib/gdata.rb.

Ответ 3

Другое решение, поместите это в свой gemfile:

gem 'gdata_19', '1.1.5'
gem 'contacts', :git => '[email protected]:eofferma/contacts.git'