Ruby: Difference between revisions
imported>Fufexan m Add page to Development category |
Phanirithvij (talk | contribs) m spell |
||
(One intermediate revision by one other user not shown) | |||
Line 41: | Line 41: | ||
* [https://github.com/manveru/bundix manveru/bundix] Generates a Nix expression for your Bundler-managed application | * [https://github.com/manveru/bundix manveru/bundix] Generates a Nix expression for your Bundler-managed application | ||
* [https://nixos.org/nixpkgs/manual/#sec-language-ruby Chapter 9.14 Ruby of the | * [https://nixos.org/nixpkgs/manual/#sec-language-ruby Chapter 9.14 Ruby of the nixpkgs manual] | ||
[[Category: Development]] | [[Category: Development]] | ||
[[Category:Languages]] |
Latest revision as of 15:55, 15 September 2024
Troubleshooting
Trouble with native dependencies
Few gems will force include paths for their native dependencies in the extconf.rb describing their native dependencies.
This issue will exhibit symptoms like being unable to find dependencies that are made available through nix when building; either through bundix or simple bundler calls.
A simple fix is to fork the gem into an alternative location, apply the fix that follows, and then reference the new git repository with fix for the gem.
The fix will probably look like this (for ruby-filemagic):
diff --git a/ext/filemagic/extconf.rb b/ext/filemagic/extconf.rb
index 316e0ab979d243d03a967fda962a43b59a1bbdec..062e91d1023a3363962531fc8a54e7f0feb3bc26 100644
--- a/ext/filemagic/extconf.rb
+++ b/ext/filemagic/extconf.rb
@@ -1,15 +1,11 @@
require 'mkmf'
+# gcc should be able to handle this properly.
HEADER_DIRS = [
- '/opt/local/include', # MacPorts
- '/usr/local/include', # compiled from source and Homebrew
- '/usr/include', # system
]
+# gcc should be able to handle this properly.
LIB_DIRS = [
- '/opt/local/lib', # MacPorts
- '/usr/local/lib', # compiled from source and Homebrew
- '/usr/lib', # system
]
$CFLAGS << ' -Wall' if ENV['WALL']
See also
- manveru/bundix Generates a Nix expression for your Bundler-managed application
- Chapter 9.14 Ruby of the nixpkgs manual