-
Notifications
You must be signed in to change notification settings - Fork 208
Description
gem install
fails on Windows with error missing function dlopen
.
Steps (in my case on Windows 7 Professional, 64 Bit, Ruby 2.5.1, msys2):
- install Ruby via rubyinstaller-2.5.1-2-x64
ridk install
gem update —system
(unrelated to the problem, necessary for bundler)gem install sqlite3 -v 1.4.0
After some hours of searching, testing, and frustration I came up with the following workarounds that work for my setting:
Fix 1
bundle install
with a Gemfile that includes the following line:
gem "sqlite3", git: "https://github.com/larskanis/sqlite3-ruby", branch: "revert-dl"
This reverts the check for the presence of the dl functions, as proposed in #254.
In my case the install succeeded, and I was able to use sqlite3 for accessing a database. I have no idea whether these functions are needed for some functionality, and whether this might blow up at some point. The mentioned PR states they are not needed.
(This is similar to a fix that can be found in various issues and blog posts, there with branch: "add-gemspec"
, but with an updated branch based on current master.)
Fix 2a
Manually install the missing dl functions before trying to install the gem, via
$ ridk exec pacman -S mingw-w64-x86_64-dlfcn
As suggested in #250.
Fix 2b
bundle install
with a Gemfile that includes the following line:
gem "sqlite3", git: "https://github.com/stomar/sqlite3-ruby", branch: "add-dlfcn"
This is similar to fix 2a, but instead of the manual install adds dlfcn
as a dependency to the slite3 gemspec, see #260.
Conclusion
Please consider to either
- merge Don't mandate dl functions for the extention build #254, in the case that dlfcn is indeed not needed,
- or include dlfcn as a dependency (Add dlfcn as dependency for MSYS2 #260), so that a manual install is not necessary.
Note that there already have been two issues opened for this problem (#250, #248), but they have been closed (prematurely IMO) by the authors after they had been provided with a workaround.