-
Notifications
You must be signed in to change notification settings - Fork 37
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
"already initialized constant" warnings #48
Comments
We can't use Fiddle gem with Ruby installed by RubyInstaller for now. See also:
Could you report this to https://github.com/oneclick/rubyinstaller2 ? |
Thanks for notifying me! I didn't think about using fiddle as a gem. Any thoughts how to solve this? As a last resort we could switch to a custom C extension instead of using fiddle for RubyInstaller's internal use. |
Can we use the following approach?
FYI: the current approach:
|
I am also getting some warnings on my Linux system, though much less verbose, so I don't believe this strictly related to RubyInstaller, though the underlying cause may still be the same. The project I am working on is a C extension that uses
I don't get the wall of text that OP is getting, but the last few constants wrapping |
@ForeverZer0 Could you show how to reproduce your case on fresh Linux system? |
Use Bundler to generate some boilerplate for a gem with a C extension
test_project.c#include "test_project.h"
VALUE rb_mTestProject;
void Init_test_project(void)
{
rb_mTestProject = rb_define_module("TestProject");
rb_require("fiddle");
} test_project.rb# No warnings if done here
# require 'fiddle'
require_relative "test_project/version"
require_relative "test_project/test_project"
# Warnings if done here
require 'fiddle' I did notice that if the I can obviously fix this by simply checking if Fiddle is already defined prior to requiring it in C, though it was not doing it it prior to today when I ran |
I got it. |
Ah, I see, I was not aware of that distinction, though the above fix resulted in the same behavior for me. Changing the order of requires in the |
Could you try |
@kou |
It seems the warnings are gone for me with the latest gem version. |
The text was updated successfully, but these errors were encountered: