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

Apartment.configure throws NoMethodError #3

Closed
nhh opened this issue Jan 30, 2020 · 8 comments
Closed

Apartment.configure throws NoMethodError #3

nhh opened this issue Jan 30, 2020 · 8 comments

Comments

@nhh
Copy link

nhh commented Jan 30, 2020

Hi, thank you for keeping this project alive!

I installed your fork the normal way and it throws a NoMethodError when Apartment.configure is being called in an initializer.

Stacktrace:

/Users/niklashanft/Development/Ruby/faqtory/config/initializers/apartment.rb:14:in `<main>': undefined method `configure' for Apartment:Module (NoMethodError)
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:319:in `block in load'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:319:in `load'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/engine.rb:667:in `block in load_config_initializer'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/notifications.rb:182:in `instrument'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/engine.rb:666:in `load_config_initializer'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/engine.rb:624:in `block (2 levels) in <class:Engine>'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/engine.rb:623:in `each'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/engine.rb:623:in `block in <class:Engine>'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `instance_exec'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `run'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in `each'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:415:in `call'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/initializable.rb:60:in `run_initializers'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/application.rb:363:in `initialize!'
	from /Users/niklashanft/Development/Ruby/faqtory/config/environment.rb:5:in `<main>'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `require'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application.rb:106:in `preload'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
	from /Users/niklashanft/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /Users/niklashanft/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

Ideas?

@lizdeika
Copy link

I have the same issue

@jean-francois-labbe
Copy link

me too, I don't understand why

@holidayworking
Copy link

holidayworking commented Jan 31, 2020

I added the following to my Gemfile:

gem 'ros-apartment', require: 'apartment'

I don't have a problem with that.

@nhh
Copy link
Author

nhh commented Feb 1, 2020

I added the following to my Gemfile:

gem 'ros-apartment', require: 'apartment'

I don't have a problem with that.

Cool! Will try that later today, we may enhance the docs if this is the solution 💪

@nhh
Copy link
Author

nhh commented Feb 2, 2020

It seems that this fixes the issue! Thanks alot!

@rpbaltazar
Copy link
Contributor

Sorry, I missed the notification. Since I didn't have any feedback on the previous comments I was not super attentive to the repo notif. Now that I know people are starting to try it out i'll put in some more hours updating docs and helping out with it. For the current issue, I think the solution should be the described one. Since this is a simple fork with the fixes for the tests to run with rails 6 there might be the need to specify the require, depending on how rails loads the codebase

@rpbaltazar
Copy link
Contributor

I've updated the readme with this commit

Closing this issue for now. If other problems arise, i'll do my best to help out

@nhh
Copy link
Author

nhh commented Feb 4, 2020

Thankyou!

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

5 participants