2015-12-21 13 views
14

मैं प्रोग्रामिंग फीनिक्स पुस्तक का पालन कर रहा हूं, एक प्रमाणित उपयोगकर्ता में लॉग इन/आउट करने के लिए अनुभाग पर काम कर रहा हूं, और मुझे एक त्रुटि प्राप्त हो रही है, मुझे नहीं पता कि मुझे क्या करना है:फीनिक्स त्रुटि: मॉड्यूल लोड नहीं/उपलब्ध नहीं

mix phoenix.server 
Compiled lib/rumbl.ex 
Compiled lib/rumbl/repo.ex 
Compiled web/channels/user_socket.ex 
Compiled web/web.ex 
Compiled web/models/user.ex 

== Compilation error on file web/router.ex == 
** (UndefinedFunctionError) undefined function: Rumbl.Auth.init/1 (module Rumbl.Auth is not available) 
    Rumbl.Auth.init([repo: Rumbl.Repo]) 
    (plug) lib/plug/builder.ex:198: Plug.Builder.init_module_plug/3 
    (plug) lib/plug/builder.ex:186: anonymous fn/4 in Plug.Builder.compile/3 
    (elixir) lib/enum.ex:1387: Enum."-reduce/3-lists^foldl/2-0-"/3 
    (plug) lib/plug/builder.ex:186: Plug.Builder.compile/3 
    web/router.ex:4: (module) 
    (stdlib) erl_eval.erl:669: :erl_eval.do_apply/6 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file lib/rumbl/endpoint.ex == 
** (UndefinedFunctionError) undefined function: Rumbl.Router.init/1 (module Rumbl.Router is not available) 
    Rumbl.Router.init([]) 
    (plug) lib/plug/builder.ex:198: Plug.Builder.init_module_plug/3 
    (plug) lib/plug/builder.ex:186: anonymous fn/4 in Plug.Builder.compile/3 
    (elixir) lib/enum.ex:1387: Enum."-reduce/3-lists^foldl/2-0-"/3 
    (plug) lib/plug/builder.ex:186: Plug.Builder.compile/3 
    (phoenix) expanding macro: Phoenix.Endpoint.__before_compile__/1 
    lib/rumbl/endpoint.ex:1: Rumbl.Endpoint (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/views/user_view.ex == 
** (CompileError) web/views/user_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/views/user_view.ex:2: Rumbl.UserView (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/views/user_view.ex:2: Rumbl.UserView (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/views/error_view.ex == 
** (CompileError) web/views/error_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/views/error_view.ex:2: Rumbl.ErrorView (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/views/error_view.ex:2: Rumbl.ErrorView (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/controllers/auth.ex == 
** (CompileError) web/controllers/auth.ex:3: module Comeonin.Bcypt is not loaded and could not be found 
    (stdlib) erl_eval.erl:669: :erl_eval.do_apply/6 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/controllers/user_controller.ex == 
** (CompileError) web/controllers/user_controller.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/controllers/user_controller.ex:2: Rumbl.UserController (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/controllers/user_controller.ex:2: Rumbl.UserController (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/controllers/page_controller.ex == 
** (CompileError) web/controllers/page_controller.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/controllers/page_controller.ex:2: Rumbl.PageController (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/controllers/page_controller.ex:2: Rumbl.PageController (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/views/session_view.ex == 
** (CompileError) web/views/session_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/views/session_view.ex:2: Rumbl.SessionView (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/views/session_view.ex:2: Rumbl.SessionView (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/views/page_view.ex == 
** (CompileError) web/views/page_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/views/page_view.ex:2: Rumbl.PageView (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/views/page_view.ex:2: Rumbl.PageView (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/views/layout_view.ex == 
** (CompileError) web/views/layout_view.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/views/layout_view.ex:2: Rumbl.LayoutView (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/views/layout_view.ex:2: Rumbl.LayoutView (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 


== Compilation error on file web/controllers/session_controller.ex == 
** (CompileError) web/controllers/session_controller.ex:2: module Rumbl.Router.Helpers is not loaded and could not be found 
    expanding macro: Rumbl.Web.__using__/1 
    web/controllers/session_controller.ex:2: Rumbl.SessionController (module) 
    (elixir) expanding macro: Kernel.use/2 
    web/controllers/session_controller.ex:2: Rumbl.SessionController (module) 
    (elixir) lib/kernel/parallel_compiler.ex:100: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8 

मैंने पुस्तक के खिलाफ अपना कोड चेक और दो बार चेक किया है, लेकिन कुछ भी नहीं देख सकता है।
परियोजना के लिए मेरे फ़ाइलों यहां हैं: https://github.com/bordeltabernacle/learning-phoenix/tree/master/rumbl

जहां तक ​​मेरा Rumbl.Auth.init समारोह बता सकते हैं auth.ex नियंत्रक फ़ाइल में है, और मुझे यकीन है कि क्या Rumbl.Router.Helpers फ़ाइल है या यह कैसे लोड करने के लिए नहीं कर रहा हूँ। जब मैं router.ex फ़ाइल में एकमात्र नई पंक्ति को हटाता हूं, चूंकि ऐप काम कर रहा था, तो मुझे एक ही त्रुटि मिलती है।
मुझे डर है कि मुझे अभी तक समस्या निवारण के लिए पर्याप्त जानकारी नहीं है।

उत्तर

8

आप मिल गया है टाइपो https://github.com/bordeltabernacle/learning-phoenix/blob/master/rumbl/web/controllers/auth.ex

में
import Comeonin.Bcypt, only: [checkpw: 2] 

होना चाहिए
import Comeonin.Bcrypt, only: [checkpw: 2] 
13

मुझे लगता है कि तुम इतनी

mix deps.clean --all 
mix deps.get 
mix deps.compile 
mix phoenix.server 

गुड लक कोशिश deps साफ करने के लिए है, तो हो जाते हैं और फिर से संकलन से पहले

तोड़ कोशिश करनी चाहिए

+2

'मिश्रण deps.compile' करने से मुझे मेरे दृश्य मॉड्यूल के साथ अब और पता नहीं लगाया गया। – Vantalk

1

तुम भी _build निर्देशिका हटा सकते हैं और mix phoenix.server (फीनिक्स 1.2) या mix phx.server (फीनिक्स 1.3) के साथ अपने सर्वर को पुनः आरंभ कर सकते हैं।

ऐसा करने से पहली बार सभी निर्भरताओं को खरोंच से लाया जाएगा। मैं इस विधि को पसंद करता हूं क्योंकि मुझे कमांड का एक समूह टाइप करने की आवश्यकता नहीं है, मुझे बस एक निर्देशिका को हटाने की आवश्यकता है और मेरे टर्मिनल पर हालिया कमांड को फिर से चलाने की जरूरत है .. जो mix phx.server है। हाँ, मैं आलसी हूँ।

शुभकामनाएं।

संबंधित मुद्दे