Rails cannot find generator class

I have a code that uses SyncEnumerator. As you can see here , SyncEnumerator requires generator.rb. To enable this, the developer of this plugin requires a "generator". This worked on my previous installation of Rails, but does not work since I updated OS X and reinstalled Rails. Now, when I try to set my gems, I get:

Macintosh:mls TAmoyal$ sudo rake gems:install
(in /Users/TAmoyal/Desktop/RoR_Projects/mls)
rake aborted!
no such file to load -- generator

(See full trace by running task with --trace)

Stack trace:

/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require': no such file to load -- generator (MissingSourceFile)
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/lib/blackbook/importer/page_scraper.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/lib/blackbook/importer/aol.rb:1:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/lib/blackbook.rb:68:in `block in <top (required)>'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/lib/blackbook.rb:68:in `each'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/lib/blackbook.rb:68:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/vendor/plugins/blackbook/init.rb:1:in `block in evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `eval'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `block in evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:142:in `evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin.rb:48:in `load'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in `block in load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:348:in `load_plugins'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:163:in `process'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
    from /Users/TAmoyal/Desktop/RoR_Projects/mls/config/environment.rb:13:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/commands/server.rb:84:in `<top (required)>'
    from script/server:3:in `require'
    from script/server:3:in `<main>'

Does anyone know how to solve this?

Thanks!

+3
source share
4 answers

Rails. SyncEnumerator Generator Ruby Core Library. Ruby 1.8.x.

?

EDIT:

Ruby 1.9 Generator Fibers. . .

, , Ruby 1.9. Generator SyncEnumerator Ruby 1.8.x, , .

+3

1.9 Enumerator:: Generator

'' Generator = Enumerator

GL. -r

+1

I had this problem with ruby ​​1.8, and I found that my problem is that I require a "generator" and change it to require "generator.rb" fixed it. I believe this was due to a conflict in rails with my Generator class

+1
source

SyncEnumerator moved to rexml/syncenumerator in Ruby 1.9.x, you can use it by doingrequire 'rexml/syncenumerator'

0
source

Source: https://habr.com/ru/post/1711378/


All Articles