I switched recently to the Nix package manager instead of Homebrew for OS X.
Usually, I install it with rbenv like:
brew install rbenv
rbenv install 2.2.0
I am asking myself now how does one do it with Nix? I've heard Nix itself is a good enough package manager, so maybe I can get rid of rbenv
for handling my ruby version?
When I install ruby via Nix
nix-env -i ruby
Even when OS X recognises it:
$ which ruby
/Users/USERNAME/.nix-profile/bin/ruby
I am still getting a Permission denied
error when trying to:
gem install sass
Would you still recommend rbenv for handling ruby installations? I know I could just chown the Nix folder, but I should own it anyway.
I've had similar experience using python with nix
.
Generally the approach when using nix is NOT to:
gem
, pip
, ...)Instead the nix
way (from what I've learned) to do things is:
nix
nix
(or gem
), you define a nix
expression that describes your applications dependencies and use it as a development environment. (I think the documentation should be improved in this matter.) RPATH
s. But this does not work well with e.g. python packages.) In the end what you really want is the application, not the library!You can find some documentation on how to set up such environments in the official nixpkgs
documentation, mostly covering Haskell at the moment, but Ruby should be similar.