Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant SolidusAffirmV2::PaymentMethod (NameError) #17

Open
yousamaa opened this issue Dec 25, 2023 · 0 comments
Open

uninitialized constant SolidusAffirmV2::PaymentMethod (NameError) #17

yousamaa opened this issue Dec 25, 2023 · 0 comments

Comments

@yousamaa
Copy link

I upgraded my rails app from 6.1 to 7.0 and now I am getting this error. I edited the engine.rb file locally using bundle open command and it worked fine. This is my edited file:
`# frozen_string_literal: true

require 'spree/core'
require 'solidus_affirm_v2'

module SolidusAffirmV2
class Engine < Rails::Engine
include SolidusSupport::EngineExtensions

isolate_namespace ::Spree

engine_name 'solidus_affirm_v2'
config.autoload_once_paths << "#{root}/app/helpers"

# use rspec for tests
config.generators do |g|
  g.test_framework :rspec
end

initializer "register_solidus_affirm_v2_payment_method", after: "spree.register.payment_methods" do |app|
  config.to_prepare do
    app.config.spree.payment_methods << SolidusAffirmV2::PaymentMethod
  end
end

initializer "register_solidus_affirm_v2_configuration", before: :load_config_initializers do |_app|
  config.to_prepare do
    SolidusAffirmV2::Config = SolidusAffirmV2::Configuration.new
  end
end

initializer 'register_solidus_affirm_v2_helper_action_controller' do |_app|
  ActiveSupport.on_load :action_controller do |klass|
    next if klass.name == "ActionController::API"

     helper SolidusAffirmV2::AffirmHelper
          end
end

end
end
`

Traceback (most recent call last): 50: from bin/rails:4:in

'
49: from /home/dev/.rvm/gems/ruby-2.7.8/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' 48: from /home/dev/.rvm/gems/ruby-2.7.8/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
47: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands.rb:18:in <main>' 46: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/command.rb:48:in invoke'
45: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/command/base.rb:87:in perform' 44: from /home/dev/.rvm/gems/ruby-2.7.8/gems/thor-1.3.0/lib/thor.rb:527:in dispatch'
43: from /home/dev/.rvm/gems/ruby-2.7.8/gems/thor-1.3.0/lib/thor/invocation.rb:127:in invoke_command' 42: from /home/dev/.rvm/gems/ruby-2.7.8/gems/thor-1.3.0/lib/thor/command.rb:28:in run'
41: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands/server/server_command.rb:134:in perform' 40: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands/server/server_command.rb:134:in tap'
39: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands/server/server_command.rb:143:in block in perform' 38: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands/server/server_command.rb:36:in start'
37: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/commands/server/server_command.rb:76:in log_to_stdout' 36: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/server.rb:422:in wrapped_app'
35: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/server.rb:249:in app' 34: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/server.rb:349:in build_app_and_options_from_config'
33: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/builder.rb:66:in parse_file' 32: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/builder.rb:105:in load_file'
31: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/builder.rb:116:in new_from_string' 30: from /home/dev/.rvm/gems/ruby-2.7.8/gems/rack-2.2.8/lib/rack/builder.rb:116:in eval'
29: from config.ru:3:in block in <main>' 28: from config.ru:3:in require_relative'
27: from /home/dev/Documents/sample-store/config/environment.rb:5:in <main>' 26: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/application.rb:372:in initialize!'
25: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:60:in run_initializers' 24: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:205:in tsort_each'
23: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:226:in tsort_each' 22: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:347:in each_strongly_connected_component'
21: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:347:in call' 20: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:347:in each'
19: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:349:in block in each_strongly_connected_component' 18: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:415:in each_strongly_connected_component_from'
17: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:415:in call' 16: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:50:in tsort_each_child'
15: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:50:in each' 14: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:421:in block in each_strongly_connected_component_from'
13: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:415:in each_strongly_connected_component_from' 12: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:415:in call'
11: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:50:in tsort_each_child' 10: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:50:in each'
9: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:421:in block in each_strongly_connected_component_from' 8: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:431:in each_strongly_connected_component_from'
7: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from' 6: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from'
5: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' 4: from /home/dev/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0/tsort.rb:228:in block in tsort_each'
3: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:61:in block in run_initializers' 2: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:32:in run'
1: from /home/dev/.rvm/gems/ruby-2.7.8/gems/railties-7.0.2/lib/rails/initializable.rb:32:in instance_exec' /home/dev/.rvm/gems/ruby-2.7.8/bundler/gems/solidus_affirm_v2-e14eac886ea2/lib/solidus_affirm_v2/engine.rb:20:in block in class:Engine': uninitialized constant SolidusAffirmV2::PaymentMethod (NameError)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant