问题
i want try Phoenix framework, but can not take it
I install elixir brew install elixir
, after it, i install Phoenix mix archive.install /path/to/archive
and try mix phoenix.new new_app
and get the error:
** (UndefinedFunctionError) undefined function:crypto.strong_rand_bytes/1 (module :crypto is not available)
:crypto.strong_rand_bytes(64)
lib/phoenix_new.ex:459: Mix.Tasks.Phoenix.New.random_string/1
lib/phoenix_new.ex:187: Mix.Tasks.Phoenix.New.run/4
(mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
(elixir) lib/code.ex:363: Code.require_file/2
Elixir -v 1.1.1
mix -v 1.1.1
erlang/OTP 18
OSX 10.11.1
回答1:
Try running this:
$ mix deps.get
$ mix deps.compile
It may be that the crypto module didn't get pulled down. Either way the output of those commands may help you to get a better idea of what the issue is.
回答2:
Erlang was installed with brew, but was unlinked.
brew link erlang
solve my trouble
来源:https://stackoverflow.com/questions/34040778/can-not-generate-phoenix-app