After Renaming Elixir/Phoenix Codebase: variable "X" does not exist and is being expanded to "X()" -
i renamed codebase livestory citybuilder. used find , replace on text in files, mv rename directories. codebase search livestory returns 0 results. https://stackoverflow.com/editing-help
when run mix phx.server
, get:
variable "citybuilder" not exist , being expanded "citybuilder()", please use parentheses remove ambiguity or change variable name mix.exs:1
i tried running mix deps.clean
, mix deps.get
. same result "citybuilder not exist".
i found similar question here, doesn't apply me i'm running latest versions of elixir , phoenix:
phoenix setup failing: compilation error, (keyerror) key :model not found
*
mix.exs
defmodule citybuilder.mixfile use mix.project def project [app: :citybuilder, version: "0.0.1", elixir: "~> 1.4", elixirc_paths: elixirc_paths(mix.env), compilers: [:phoenix, :gettext] ++ mix.compilers, build_embedded: mix.env == :prod, start_permanent: mix.env == :prod, aliases: aliases(), deps: deps()] end # configuration otp application. # # type `mix compile.app` more information. def application [mod: {citybuilder.application, []}, applications: [ :logger, :postgrex, :ecto, :timex, :phoenix, :phoenix_html, :phoenix_pubsub, :phoenix_ecto, :cowboy, :gettext, :guardian, :comeonin, :recaptcha, :edeliver ] ] end # specifies paths compile per environment. defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] # specifies project dependencies. # # type `mix deps` examples , options. defp deps [{:phoenix, "~> 1.3.0-rc", override: true}, {:phoenix_pubsub, "~> 1.0"}, {:phoenix_ecto, "~> 3.2"}, {:postgrex, ">= 0.0.0"}, {:phoenix_html, "~> 2.6"}, # official repository, not hex, because latest patches not released yet {:recaptcha, "~> 2.0", github: "samueljseay/recaptcha"}, {:timex, "~> 3.0"}, {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, {:guardian, "~> 0.14"}, {:comeonin, "~> 3.0"}, {:distillery, "~> 1.0"}, {:edeliver, "~> 1.4.0"}] end # aliases shortcuts or tasks specific current project. # example, create, migrate , run seeds file @ once: # # $ mix ecto.setup # # see documentation `mix` more info on aliases. defp aliases ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], "test": ["ecto.create --quiet", "ecto.migrate", "test"]] end end
i made case-insensitive search , replace , livestory became citybuilder (instead of citybuilder.) elixir not recognize citybuilder atom, instead tries lookup citybuilder variable , call citybuilder function.
i fixed finding , replacing citybuilder citybuilder.
note: there applications, postgres, require citybuilder lowercase.
Comments
Post a Comment