Change:
gem install rails - failed how to install rails on NixOS with Ruby 1.9 (not 1.8) ? and how to update installed gems - gem update - also failed ? PS. all gem commands failed due to nix store is protected
We have a few gems (including rails) packaged through nixpkgs. nix-env -i ruby-rails-3.2.6 should work (default ruby is 1.9)
Your receipt "nix-env -i ruby-rails-3.2.6" install successful but don't work due to rails belongs to rubygems instead gem from ruby-1.9 and failed find rack. [root rails -v /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems- tospecs': Could not find rack (= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.7.3, json-1.5.4, minitest-2.5.1, rack-ssl-1.3.2, railties-3.2.6, rake-0.9.2.2, rdoc-3.12, rdoc-3.9.4] (Gem::LoadError) from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems-block in activatedependencies' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems- each' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems-activatedependencies' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems- activate' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems-block in activatedependencies' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems- each' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems-activate_dependencies' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems- activate' from /nix/store/vyqv3ffri4fbwwd173a4xj9fj3qmsq0b-rubygems-gem' from /nix/store/0iazqkijlf3cc095lflwqvdlmg0mc72a-ruby-railties- `<main'
Oh, sorry, you'll also need to add to your GEM_PATH, and you might also need to have and RUBYOPT=rubygems
Thank you. Later I'll test your recommendations for server based on NixOS (now it's still work on Gentoo) But now I found temporary solution to use rvm on notebooks with NixOS for study NixOS, rails and haskell. It's enough: pkgs: git gcc bash curl openssl sqlite patch readline zlib libyaml #iconv libxml2 libxslt libtool bison v8 nodejs curl -L | bash -s stable source rvm pkg install zlib rvm pkg install readline rvm pkg install openssl rvm install 1.9.3 // : q rvm use 1.9.3 --default rvm use 1.9.3 --create rvm use 1.9.3 --default gem install rails gem install sqlite3-ruby -- --with-sqlite3-dir=/nix/store/sqlite // replace to actual path in store gem install libv8 cd toyourapp bundle install
thank you. It work for me, but also requires and packages for Nix system and & for . And I didn't add , and to Nix packages. UPD: but still not able to install gem ...

Discussion:
|---------------------------+--------------------------------------------| | Model                     | Path                                       | |---------------------------+--------------------------------------------| <del> | Acer Aspire 4810T         | ~<nixos-hardware/acer/aspire/4810t>~       | </del> <ins> | [[file:acer/aspire/4810t][Acer Aspire 4810T]]         | ~<nixos-hardware/acer/aspire/4810t>~       | </ins> | Airis N990                | ~<nixos-hardware/airis/n990>~              | <del> | Apple MacBook Pro 10,1    | ~<nixos-hardware/apple/macbook-pro/10-1>~  | </del> <ins> | Apple MacBook Air 4,X     | ~<nixos-hardware/apple/macbook-air/4>~     | | Apple MacBook Air 6,X     | ~<nixos-hardware/apple/macbook-air/6>~     | | [[file:apple/macbook-pro/10-1][Apple MacBook Pro 10,1]]    | ~<nixos-hardware/apple/macbook-pro/10-1>~  | </ins> | Apple MacBook Pro 12,1    | ~<nixos-hardware/apple/macbook-pro/12-1>~  | <del> | Dell XPS 15 9550          | ~<nixos-hardware/dell/xps/15-9550>~        | | Inverse Path USB armory   | ~<nixos-hardware/inversepath/usbarmory>~   | </del> <ins> | [[file:dell/xps/15-9550][Dell XPS 15 9550]]          | ~<nixos-hardware/dell/xps/15-9550>~        | | [[file:inversepath/usbarmory][Inverse Path USB armory]]   | ~<nixos-hardware/inversepath/usbarmory>~   | </ins> | Lenovo IdeaPad Z510       | ~<nixos-hardware/lenovo/ideapad/z510>~     | | Lenovo ThinkPad T410      | ~<nixos-hardware/lenovo/thinkpad/t410>~    | | Lenovo ThinkPad T440p     | ~<nixos-hardware/lenovo/thinkpad/t440p>~   | | Lenovo ThinkPad T460s     | ~<nixos-hardware/lenovo/thinkpad/t460s>~   | | Lenovo ThinkPad X140e     | ~<nixos-hardware/lenovo/thinkpad/x140e>~   | | Lenovo ThinkPad X220      | ~<nixos-hardware/lenovo/thinkpad/x220>~    | <del> | Microsoft Surface Pro 3   | ~<nixos-hardware/microsoft/surface-pro/3>~ | | Raspberry Pi 2            | ~<nixos-hardware/raspberry-pi/2>~          | | Samsung Series 9 NP900X3C | ~<nixos-hardware/samsung/np900x3c>~        | </del> <ins> | Lenovo ThinkPad X250      | ~<nixos-hardware/lenovo/thinkpad/x250>~    | | [[file:microsoft/surface-pro/3][Microsoft Surface Pro 3]]   | ~<nixos-hardware/microsoft/surface-pro/3>~ | | [[file:raspberry-pi/2][Raspberry Pi 2]]            | ~<nixos-hardware/raspberry-pi/2>~          | | [[file:samsung/np900x3c][Samsung Series 9 NP900X3C]] | ~<nixos-hardware/samsung/np900x3c>~        | </ins> | Supermicro A1SRi-2758F    | ~<nixos-hardware/supermicro/a1sri-2758f>~  | | Supermicro X10SLL-F       | ~<nixos-hardware/supermicro/x10sll-f>~     | |---------------------------+--------------------------------------------|

<del> { lib, ... }: </del> <ins> { config, lib, ... }: </ins> { <ins> boot.kernelParams = [ "hid_apple.iso_layout=0" ]; hardware.facetimehd.enable = lib.mkDefault (config.nixpkgs.config.allowUnfree or false); </ins> services.mbpfan.enable = lib.mkDefault true; }

<ins> { lib, ... }: { imports = [ ../. ]; boot.kernelParams = [ "acpi_backlight=vendor" ]; services.xserver.deviceSection = lib.mkDefault '' Option "TearFree" "true" ''; } </ins>

"vm.laptop_mode" = lib.mkDefault 5; }; <ins> # TODO: fix in NixOS/nixpkgs # Disable governor set in hardware-configuration.nix, # required when services.tlp.enable is true: powerManagement.cpuFreqGovernor = lib.mkForce null; </ins> services.tlp.enable = lib.mkDefault true; }

<ins> { config, lib, pkgs, ... }: { imports = [ ../. ../../../common/cpu/intel ]; # Thinkfan is enabled by thinkpad profile. # However it requires to set a different `sensor` for this hardware, since there is no /proc/acpi/ibm/thermal # Regulation also works fine without thinkfan daemon though. services.thinkfan.enable = lib.mkOverride 900 false; # maintainers: Mic92 } </ins>

<ins> ** Status The code in master as of June 2015 should be able to prepare a bootable NixOS for Raspberry PI 2. There are still some drawbacks: NixOS does not provide a /boot/config.txt (the FAT32 partition). Making NixOS work in the Raspberry PI 2 is mainly the result of the recent work of ambro718, Dezgeg and viric (#nixos@irc.freenode.net). ** Download If you want to test, you can flash this 4GB SD image (DOS partition table + fat32 + ext4 rootfs): magnet:?xt=urn:btih:0def3f6acb3bceddb22cb24098f58e40e2853ec2&dn=rpi2-nixos-4b09501f2-img.xz&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80 Then you should be able to nixos-rebuild any configuration.nix changes. The image is the result of a "nixos-install" alone. No root password has been set, and it does not include a nixpkgs checkout or channel. In fact I (viric) created the FS into a NBD, not a real SD, to create this image. </ins>

<del> imported from https://nixos.org/wiki/Raspberry_Pi_2 ** # Status The code in master as of June 2015 should be able to prepare a bootable NixOS for Raspberry PI 2. There are still some drawbacks: NixOS does not provide a /boot/config.txt (the FAT32 partition). Making NixOS work in the Raspberry PI 2 is mainly the result of the recent work of ambro718, Dezgeg and viric (#nixos@irc.freenode.net). # Download If you want to test, you can flash this 4GB SD image (DOS partition table + fat32 + ext4 rootfs): magnet:?xt=urn:btih:0def3f6acb3bceddb22cb24098f58e40e2853ec2&dn=rpi2-nixos-4b09501f2-img.xz&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80 Then you should be able to nixos-rebuild any configuration.nix changes. The image is the result of a "nixos-install" alone. No root password has been set, and it does not include a nixpkgs checkout or channel. In fact I (viric) created the FS into a NBD, not a real SD, to create this image. </del>