ruby on rails - Spree frontend helpers not available, leading to"undefined local variable or method `body_class'" -
i'm trying install spree on existing application. installs successfully, when navigating spree page, "undefined local variable or method 'body_class'"
error in spree_frontend-3.0.4/app/views/spree/layouts/spree_application.html.erb
, line 10.
body_class
method in spree_frontend-3.0.4/app/helpers/spree/frontend_helper.rb
, seems helper methods file aren't available. why not?
i tried setting brand new rails app , installing spree on that, , worked. there's odd existing app that's interfering spree, can't think of might be.
here's gemfile, in case helps:
source 'https://rubygems.org' ruby '2.2.0' gem 'rails', '4.2.3' gem 'sass-rails', "~> 4.0.2" gem 'celluloid', '~> 0.16.0' gem 'unicorn' gem 'bootstrap-sass', '~> 3.3.5' gem 'bcrypt-ruby', '3.1.2' #gem 'faker', '1.1.2' gem 'kaminari' gem 'kaminari-bootstrap', '~> 3.0.1' gem 'pg' gem 'devise', '>= 3.5.1' gem "devise-async" gem 'dependent-fields-rails' gem 'underscore-rails' gem "marco-polo" gem 'aws-sdk', '~> 1.63' gem 'aws-sdk-resources', '~> 2' gem 'paperclip', "~> 4.1" gem 'delayed_job_active_record' gem 'delayed_job_web' # gem 'hirefire', :github => 'michaelkeenan/hirefire' gem 's3_direct_upload', :github => 'maxgillett/s3_direct_upload' # gem 's3_multipart', :github => 'maxgillett/s3_multipart' #gem "s3_multipart", :path => "../s3_multipart" gem "s3_multipart", :github => 'michaelkeenan/s3_multipart', :tag => 'v0.0.11.9' #gem 'rest_in_place', :git => "git://github.com/michaelkeenan/rest_in_place.git" gem 'best_in_place', '~> 3.0.1' gem 'pundit' gem 'data-confirm-modal', github: 'ifad/data-confirm-modal' gem 'money-rails' gem 'font-awesome-sass' # gem 'jquery-turbolinks' gem 'rubyzip', '~> 1.1.6', require: 'zip' gem 'obfuscate_id', '~> 0.0.5', :git => "git://github.com/michaelkeenan/obfuscate_id.git" gem 'redcarpet' gem 'pagedown-bootstrap-rails' gem 'honeybadger' gem "paranoia" gem 'paranoia_uniqueness_validator', '1.1.0' gem 'unscoped_associations' gem 'friendly_id', '~> 5.1.0' gem 'nokogiri' gem "hirefire-resource" gem 'acts_as_list' gem 'mailboxer', '~> 0.13.0' gem 'zeroclipboard-rails' gem 'bootstrap-datepicker-rails' gem "awesome_print", require:"ap" gem 'cloudfront-signer' gem 'rack-attack' group :development gem 'better_errors' gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx] gem 'rails_layout' gem 'bullet' gem 'did_you_mean', '~> 0.9.5' gem 'quiet_assets' gem 'meta_request' gem 'pry-rails' end group :development, :test gem 'spring', '~> 1.3.6' gem "spring-commands-rspec" gem 'minitest' gem 'rspec-rails', '~> 3.2' gem 'guard-rspec' gem 'rb-fsevent', :require => false #gem 'guard-zeus' gem 'growl', '1.0.3' gem 'childprocess', '0.5.0' gem 'email_spec' gem 'pry-byebug' gem 'pry-stack_explorer' gem 'pry-remote' end group :test gem 'selenium-webdriver', '2.41.0' gem 'capybara' gem 'capybara-webkit' gem 'factory_girl_rails', '4.2.1', :require => false gem 'database_cleaner' end #group :assets gem 'sprockets-rails', :require => 'sprockets/railtie' gem 'coffee-rails', '~> 4.0.0' gem 'uglifier', '>= 1.3.0' gem "fog", "~>1.28" gem 'asset_sync' #end gem 'jquery-rails', '4.0.4' gem 'jquery-ui-rails', '5.0.5' gem 'remotipart', '~> 1.2' # gem 'turbolinks' gem 'jbuilder', '~> 1.2' group :doc gem 'sdoc', '0.3.20', require: false end group :production gem 'rails_12factor', '0.0.2' gem 'lograge' end gem 'spree', '3.0.4'
this turned out due s3_multipart gem, or rather, due file generated. creates class subclassed applicationcontroller:
class itemuploader < applicationcontroller ... end
this breaks helper methods because of conditional in action_controller/railties/helpers.rb
:
if klass.superclass == actioncontroller::base && actioncontroller::base. klass.helper :all end
to solve it, change itemuploader subclass actioncontroller::base
. s3_multipart still works change, , doesn't break helper methods.
class itemuploader < actioncontroller::base ... end
Comments
Post a Comment