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

memcached gem and rubinius - wrong constant name swig_runtime_data #692

Closed
miv opened this issue Feb 18, 2011 · 2 comments
Closed

memcached gem and rubinius - wrong constant name swig_runtime_data #692

miv opened this issue Feb 18, 2011 · 2 comments

Comments

@miv
Copy link

miv commented Feb 18, 2011

Not sure if its should be in rubinius or in memcached.

My project using memcached gem (1.0.6) and trying to run it on rubinius 1.2.1 produces (only intresting part):

An exception occurred at_exit handler
    wrong constant name swig_runtime_data (NameError)

Backtrace:
    Module(Class)#normalize_const_name at kernel/common/module.rb:711
     Module(Class)#recursive_const_get at kernel/common/module.rb:678
               Module(Class)#const_get at kernel/common/module.rb:535
  { } in ActiveSupport::CoreExtensions::Module(Class)#local_constants at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/module/introspection.rb:70
                            Array#each at kernel/bootstrap/array.rb:71
  { } in ActiveSupport::CoreExtensions::Module(Class)#local_constants at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/module/introspection.rb:70
                            Array#each at kernel/bootstrap/array.rb:71
  ActiveSupport::CoreExtensions::Module(Class)#local_constants at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/module/introspection.rb:68
  ActiveSupport::CoreExtensions::Module(Class)#local_constant_names at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/module/introspection.rb:86
  { } in ActiveSupport::Dependencies(Module)#new_constants_in at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:504
                      { } in Array#map at kernel/bootstrap/array.rb:90
                            Array#each at kernel/bootstrap/array.rb:71
                   Array#collect (map) at kernel/bootstrap/array.rb:90
 ActiveSupport::Dependencies(Module)#new_constants_in at /usr/local/rubinius
                                                         /1.2.1/gems/1.8/gems
                                                         /activesupport-2.3.5
                                                         /lib/active_support
                                                         /dependencies.rb:495
 ActiveSupport::Dependencies(Module)#load_file at /usr/local/rubinius/1.2.1/gems
                                                  /1.8/gems/activesupport-2.3.5
                                                  /lib/active_support
                                                  /dependencies.rb:379
 ActiveSupport::Dependencies(Module)#require_or_load at /usr/local/rubinius
                                                        /1.2.1/gems/1.8/gems
                                                        /activesupport-2.3.5/lib
                                                        /active_support
                                                        /dependencies.rb:259
 ActiveSupport::Dependencies(Module)#depend_on at /usr/local/rubinius/1.2.1/gems
                                                  /1.8/gems/activesupport-2.3.5
                                                  /lib/active_support
                                                  /dependencies.rb:224
  ActiveSupport::Dependencies::Loadable(Object)#require_dependency at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136
                       main.__script__ at app/models/stage_item.rb:688
          Rubinius::CodeLoader.require at kernel/common/codeloader.rb:145
  Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:739
               Kernel(Object)#require at /usr/local/rubinius/1.2.1/lib/rubygems
                                         /custom_require.rb:31
  { } in ActiveSupport::Dependencies::Loadable(Object)#require at \
          /usr/local/rubinius/1.2.1/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156
 ActiveSupport::Dependencies(Module)#new_constants_in at /usr/local/rubinius
                                                         /1.2.1/gems/1.8/gems
                                                         /activesupport-2.3.5
                                                         /lib/active_support
                                                         /dependencies.rb:521
 ActiveSupport::Dependencies::Loadable(Object)#require at /usr/local/rubinius
                                                          /1.2.1/gems/1.8/gems
                                                          /activesupport-2.3.5
                                                          /lib/active_support
                                                          /dependencies.rb:156
                { } in main.__script__ at config/environment.rb:94
                            Array#each at kernel/bootstrap/array.rb:71
                       main.__script__ at config/environment.rb:94
          Rubinius::CodeLoader.require at kernel/common/codeloader.rb:145
  Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:739
               Kernel(Object)#require at /usr/local/rubinius/1.2.1/lib/rubygems
                                         /custom_require.rb:31

Which leads to activesupport's introspection.rb where we can see:

  if RUBY_VERSION < '1.9'
    # Returns the constants that have been defined locally by this object and
    # not in an ancestor. This method is exact if running under Ruby 1.9. In
    # previous versions it may miss some constants if their definition in some
    # ancestor is identical to their definition in the receiver.
    def local_constants
      inherited = {}

      ancestors.each do |anc|
        next if anc == self
        anc.constants.each { |const| inherited[const] = anc.const_get(const) }
      end

      constants.select do |const|
        !inherited.key?(const) || inherited[const].object_id != const_get(const).object_id
      end
    end
  else
    def local_constants #:nodoc:
      constants(false)
    end
  end

So when i replaced all this code with this, everything start to work fine:

def local_constants #:nodoc:
  constants()
end
@brixen
Copy link
Member

brixen commented Feb 19, 2011

@evanphx
Copy link
Member

evanphx commented Feb 21, 2011

This is a bug in swig, not in rubinius.

This issue was closed.
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

3 participants