Rails 3.2에서 Rails 4.2.8로 응용 프로그램을 업그레이드하는 동안 루비 버전은 2.3.2에서 동일하게 유지됩니다. 번들 설치 및 번들 업데이트가 경고 또는 오류없이 성공적으로 실행 중입니다.Rails 4 업그레이드를 통한 Formtastic Gem 문제
환경 : 창, 루비 2.3.2
어떤 레이크 작업을 수행 또는 서버 휴식의 시작, 아래의 오류 찾기,
레이크 작업 나누기 :
Error:[rake --tasks] C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cucumber-1.1.9/lib/cucumber/ast/feature_element.rb:52: warning: circular argument reference - name
rake aborted!
LoadError: cannot load such file -- formtastic/helpers/buttons_helper
C:/workspace/project1/lib/ext/gems/formtastic/formtastic.rb:13:in `<module:Formtastic>'
C:/workspace/project1/lib/ext/gems/formtastic/formtastic.rb:1:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
개발 서버 시작 던지기 오류 :
C:/workspace/project1/lib/ext/gems/formtastic/formtastic.rb:13:in `<module:Formtastic>': cannot load such file -- formtastic/helpers/buttons_helper (LoadError)
from C:/workspace/projects/CosmoD2Upgrade/director2/lib/ext/gems/formtastic/formtastic.rb:1:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
Gemfile :
# form builder
gem 'formtastic'
Gemfile.lock
formtastic (3.1.5)
actionpack (>= 3.2.13)
나는 문제도 2.0 버전으로 추락 확인할 수 없습니다 Formtastic 보석의 여러 버전을 시도했다. 이 문제와 관련된 패치 나 수정 사항이 있으면 알려주십시오.
업데이트 :
Error:[rake --tasks] C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cucumber-1.1.9/lib/cucumber/ast/feature_element.rb:52: warning: circular argument reference - name
rake aborted!
LoadError: cannot load such file -- formtastic/helpers/buttons_helper
C:/workspace/project/lib/ext/gems/formtastic/formtastic.rb:13:in `<module:Formtastic>'
C:/workspace/project/lib/ext/gems/formtastic/formtastic.rb:1:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
C:/workspace/project/config/application.rb:9:in `block in <top (required)>'
C:/workspace/project/config/application.rb:9:in `each'
C:/workspace/project/config/application.rb:9:in `<top (required)>'
C:/workspace/project/Rakefile:4:in `require'
C:/workspace/project2/Rakefile:4:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:686:in `raw_load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:96:in `block in load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:95:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:79:in `block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
C:/workspace/project/bin/rake:4:in `<main>'
Polyglot::PolyglotLoadError: Failed to load C:/workspace/project/lib/ext/gems/formtastic/formtastic.rb using extensions rb, treetop, tt
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:55:in `load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:68:in `rescue in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
C:/workspace/project/config/application.rb:9:in `block in <top (required)>'
C:/workspace/project/config/application.rb:9:in `each'
C:/workspace/project/config/application.rb:9:in `<top (required)>'
C:/workspace/project/Rakefile:4:in `require'
C:/workspace/project/Rakefile:4:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/rake_module.rb:28:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:686:in `raw_load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:96:in `block in load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:95:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:79:in `block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
C:/workspace/projects/bin/rake:4:in `<main>'
오류 지점 아래의 파일 레이크 실패의 오류 스택 추적과 buttonhelper 통화를 포함합니다. 당신이 formtastic
과 formtastic-bootstrap
보석을 사용하여 같은
.....
Line no 13:
module Helpers::ButtonsHelper
def commit_button(*args)
options = args.extract_options!
text = options.delete(:label) || args.shift
text = (localized_string(commit_button_i18n_key, text, :action, :model => commit_button_object_name) ||
Formtastic::I18n.t(commit_button_i18n_key, :model => commit_button_object_name)) unless text.is_a?(::String)
button_html = options.delete(:button_html) || {}
button_html.merge!(:class => [button_html[:class], commit_button_i18n_key].compact.join(' '))
wrapper_html = options.delete(:wrapper_html) || {}
wrapper_html[:class] = (commit_button_wrapper_html_class << wrapper_html[:class]).flatten.compact.join(' ')
accesskey = (options.delete(:accesskey) || default_commit_button_accesskey) unless button_html.has_key?(:accesskey)
button_html = button_html.merge(:accesskey => accesskey) if accesskey
Formtastic::Util.html_safe(submit(text, button_html))
end
end
.....
그 해답을 보았지만 formtastic-bootstrap gem을 사용하지 않았습니다. 내 프로젝트 폴더에 관련 파일을 포함시킨 후 부트 스트랩을 사용하고 있습니다. Gemfile.lock은 qsn에서 언급 한 것처럼 formtastic이 actionpack에만 의존한다는 것을 보여줍니다. – Bijendra
오류 메시지는 코드에서 (직접 또는 보석에) 어딘가에'formtastic/helpers/buttons_helper'가 필요하다는 것을 알려줍니다. 이 모듈은'formtastic'의 최신 버전에는 더 이상 존재하지 않습니다. 도우미가 필요하거나 (또는 Gemfile.lock을 게시하는) gem을 요구하는 파일을 게시하십시오. – spickermann
나는 내 qsn을 참조를 가리키는 오류 스택 추적으로 업데이트했습니다. formtastic.rb에서 호출되고 있습니다. github 페이지에서도 deprecation 메시지를 보았습니다.하지만 여전히 참조가 여전히 보석 코드에 남았습니다. – Bijendra