selector 'nix-repl' matches no derivations - nix

I have nix installed
➜ which nix
/Users/rabraham/.nix-profile/bin/nix
➜ nix --version
nix (Nix) 2.1.3
Nix Channel is:
➜ cat ~/.nix-channels
https://nixos.org/channels/nixos-18.09 nixpkgs
But I can't install nix-repl
➜ nix-env -i nix-repl
error: selector 'nix-repl' matches no derivations

The documentation is outdated. I think it is nix repl from Nix 2.0 onwards

Related

Why can't I update nix?

I'm using nixos on wsl.
According to this link
nix --version
shoud return 2.11.0 . On my computer this is 2.8.1 Therefore I don't have the last nix version.
I've fast followed this procedure. I've only changed nixpkg with nixos because I'm on nixos (as the documentation say)
nix-channel --update;
nix-env -iA nixos.nix nixos.cacert;
First try:
nix --version
2.8
I continue as if I had more than one user
systemctl daemon-reload;
systemctl restart nix-daemon
nix --version
2.8
Why I don't have the right version

OSX homebrew Lua51 cannot find lua command

When I install lua51 with brew, it is not able to run the command. However when I install just lua (homebrew install lua 5.2 by default) the lua command works.
I tried brew link but that shows lua51 already linked.
here is a transcript
$ brew install lua (master)
Updating Homebrew...
....... Install output .......
🍺 /usr/local/Cellar/lua/5.2.4_4: 144 files, 705.5KB
$ lua (master)
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>
$ brew uninstall lua (master)
Uninstalling /usr/local/Cellar/lua/5.2.4_4... (144 files, 705.5KB)
$ lua (master)
zsh: command not found: lua
$ brew install lua51 (master)
==> Downloading https://homebrew.bintray.com/bottles/lua#5.1-5.1.5_4.el_capitan.bottle.tar.gz
....... Install output .......
🍺 /usr/local/Cellar/lua#5.1/5.1.5_4: 136 files, 702.2KB
$ lua (master)
zsh: command not found: lua
I downloaded https://homebrew.bintray.com/bottles/lua#5.1-5.1.5_4.el_capitan.bottle.tar.gz and saw that it contains
./5.1.5_4/bin/lua-5.1
./5.1.5_4/bin/lua5.1 -> lua-5.1
So, you need to run lua-5.1 or lua5.1, not plain lua.

Cliver and PhantomJS error with update to MacOS Sierra

I updated from OSX El Capitan to MacOS Sierra and began seeing PhantomJS errors.
$ rspec <some feature test
... The detector #<struct Cliver::Detector command_arg=nil, version_pattern=nil> failed to detect theversion of the executable at '/app/node_modules/phantomjs-prebuilt/bin/phantomjs'
How can I resolve this?
After some playing around, I realized that $ phantomjs --version was not returning anything. Strange. I also checked both
$ brew list
$ npm ls
and saw that neither listed phantomjs as one of their packages. Looks like I had an issue with my phantomjs install. I decided to do a completely fresh install of phantomjs.
I began by determining where phantomjs is installed:
$ which phantomjs
/usr/local/bin/phantomjs
Remove it:
$ rm -rf /usr/local/bin/phantomjs
$ phantomjs -v
-bash: /usr/local/bin/phantomjs: No such file or directory
Good. Now install phantomjs with npm:
$ npm -g install phantomjs-prebuilt
$ phantomjs -v
2.1.1
This looks promising. Lets run our spec again:
$ rspec <some feature test>
1 example, 0 failures
Success.

Elixir not starting up

I am trying to run v1.0 of Elixir and I've installed Erlang 17.4. When I try to run iex I get a series of errors that I don't understand:
$ iex -v
{error_logger,{{2015,11,11},{10,35,48}},crash_report,[[{initial_call,{supervisor_bridge,user_sup,['Argument__1']}},{pid,<0.22.0>},{registered_name,[]},{error_info,{exit,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,99}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,48}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,79}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,330}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[kernel_sup,<0.10.0>]},{messages,[]},{links,[<0.11.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,176}],[]]}
{error_logger,{{2015,11,11},{10,35,48}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,99}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,48}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,79}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{offender,[{pid,undefined},{name,user},{mfargs,{user_sup,start,[]}},{restart_type,temporary},{shutdown,2000},{child_type,supervisor}]}]}
{error_logger,{{2015,11,11},{10,35,48}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,99}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,48}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,79}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,133}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,147}],[]]}
{error_logger,{{2015,11,11},{10,35,48}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,99}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,48}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,79}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}}},{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,\"user_sup.erl\"},{line,99}]},{user_sup,init,1,[{file,\"user_sup.erl\"},{line,48}]},{supervisor_bridge,init,1,[{file,\"supervisor_bridge.erl\"},{line,79}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]}}},{kernel,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_su
I'm running Mac OS 10.10
It looks like things are not properly installed.
Unless you have a special need to install it yourself, I'd recommend wiping out whatever you've done so far, then installing the Homebrew package manager and then brew install elixir
Try to find elixir in your local library and remove all.
then try to install with asdf:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.3
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
Open a new iterm tab:
asdf plugin-add erlang
asdf plugin-add elixir
brew install coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc
ERLANG_OPENSSL_PATH="/usr/local/opt/openssl" asdf install erlang <version>
asdf global erlang <version>
asdf install elixir <version>
asdf global elixir <version>

How to tell if homebrew is installed on Mac OS X

I am doing some Rails programming and I consistently see Homebrew referenced in solutions around the web but have never used it.
I also notice Homebrew in the terminal version 2.9 as an option next to "Shell -> New" from the terminal drop down but when I select homebrew and issue commands, they fail.
Usually with the "command not found" error.
Strangely enough I have been unable to locate a simple command to determine whether brew is installed or not.
How do I check to see if Homebrew is already installed on my Mac?
brew help. If brew is there, you get output. If not, you get 'command not found'. If you need to check in a script, you can work out how to redirect output and check $?.
I use this to perform update or install:
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
The standard way of figuring out if something is installed is to use which.
If Brew is installed.
>>> which brew
/usr/local/bin/brew
If Brew is not installed.
>>> which brew
brew not found
Note: The "not installed" message depends on your shell. zsh is shown above. bash will just not print anything. csh will say brew: Command not found. In the "installed" case, all shells will print the path.)
It works with all command line programs. Try which grep or which python. Since it tells you the program that you're running, it's helpful when debugging as well.
While which is the most common way of checking if a program is installed, it will tell you a program is installed ONLY if it's in the $PATH. So if your program is installed, but the $PATH wasn't updated for whatever reason*, which will tell you the program isn't installed.
(*One example scenario is changing from Bash to Zshell and ~/.zshrc not having the old $PATH from ~/.bash_profile)
command -v foo is a better alternative to which foo. command -v brew will output nothing if Homebrew is not installed
command -v brew
Here's a sample script to check if Homebrew is installed, install it if it isn't, update if it is.
if [[ $(command -v brew) == "" ]]; then
echo "Installing Hombrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Updating Homebrew"
brew update
fi
brew -v or brew --version does the trick!
I just type brew -v in terminal if you have it it will respond with the version number installed.
Location of the brew where it installed
which brew
version of home brew install
brew --version
[ ! -f "`which brew`" ] && echo "not installed"
Explaination: If brew is not installed run command after &&
brew doctor checks if Homebrew is installed and working properly.
use either the which or type built-in tools.
i.e.: which brew or type brew
Maybe your mac don't received the path
enter image description here
Run command below
eval "$(/opt/homebrew/bin/brew shellenv)"
And run to check that work
brew help
Beginners normally do, the homebrew --version which is wrong.
Do instead, brew --version. brew help works also. If these two commands are not executed, you don't have homebrew installed.
Another one possible way:
# Check if Ninja is installed
if ! which ninja > /dev/null
then
echo 'Ninja installation...'
brew install ninja
fi
In my case Mac OS High Sierra 10.13.6
brew -v
OutPut-
Homebrew 2.2.2
Homebrew/homebrew-core (git revision 71aa; last commit 2020-01-07)
Homebrew/homebrew-cask (git revision 84f00; last commit 2020-01-07)
Yes you can run which brew, but you may have it installed and it says it is not found if you are using zsh. You will need to add it to your .zshrc file.
I find it simple to use brew help command to find it is installed or not. There was a user guide on the homebrew download page.
If it is not installed then it will show 'command not found'
If you need to install homebrew then paste this on terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
jest write brew -v in terminal and if you have it , you will see there version number and the install date .
like this :
Homebrew 3.3.12
Homebrew/homebrew-core (git revision c3cacc9cd1d; last commit 2022-01-31)
Homebrew/homebrew-cask (git revision fb6ec06d8b; last commit 2022-01-31)
Once you install Homebrew, type command brew doctor in terminal.
If you get the following message:
Your system is ready to brew
then you are good to go and you have successfully installed homebrew.
If you get any warnings, you can try fixing it.
Another way to do it is using the "command" builtin tool
if [ "$(command -v brew)" ]; then
echo "command \"brew\" exists on system"
fi
in your terminal, do which brew and itll tell you where it was installed at within your computer, but itll only work in zsh not in bash.
Running Catalina 10.15.4 I ran the permissions command below to get brew to install
sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*

Resources