Rails: AbstractController::Helpers::MissingHelperError - Missing helper file application_helper.rb_helper.rb

后端 未结 13 2003
庸人自扰
庸人自扰 2020-12-09 04:18

Can\'t find any resource that\'s helped me in this! When I try to \'rails s\' and go to any page of the app; it shoots me this error page saying I am missing helper files.

相关标签:
13条回答
  • 2020-12-09 04:40

    Simply moving/renaming the folder didn't work for me. I had to rename the existing folder, create a new folder with the same name, then copy everything to it. Then I deleted the old renamed folder.

    0 讨论(0)
  • 2020-12-09 04:41

    I started getting the same missing helper message when running tests, even though my app ran OK in dev mode. And this started right after I had run my tests successfully, with no system changes that I was aware of. After trying the suggestion to remove uppercase filenames from my path without success, I ran rvm, in my case

    rvm use ruby-2.2.0@rails4.2
    bundle install
    

    The problem went away. I suspect my system had rebooted and started using some incompatible system Ruby module. I am a beginner working my way through Michael Hartl's rails tutorial on OS X 10.10.3.

    0 讨论(0)
  • 2020-12-09 04:41

    I get this error while running rails s on windows powershell but not on cmd. I sugest using a different CLI.

    0 讨论(0)
  • 2020-12-09 04:43

    For me this issue was caused because I was using GitBash on Windows, and running my tests from there. Looks like a case mismatch on what bash is expecting vs the actual folder names. Ran it from cmd and worked fine.

    0 讨论(0)
  • 2020-12-09 04:44

    Step-by-Step Guide:

    On OSX, I had changed my username to Psy from psy. So figuring the problem out was a pain in the ass. Following these steps helped me out:

    1. Run irb and execute this command in your project folder:

      File.expand_path("./")
      # => "/Users/psy/code/rails_app"
      
    2. Now exit irb and run this command in your shell:

      $ pwd
      # => /Users/Psy/code/rails_app
      
    3. Compare the two and notice the directory with the case difference, in this case it's Psy

    4. Rename that directory to anything, and then rename it back to the original folder (use sudo only if necessary)

      $ sudo mv /Users/Psy /Users/tmp
      $ sudo mv /Users/tmp /Users/Psy
      
    0 讨论(0)
  • 2020-12-09 04:44

    While the answer Zubin provided worked for me on my personal machine I just ran into the same issue on a work machine where it didn't exactly. I'd created sites as a lowercase dir:

    mkdir sites 
    

    Renaming with a capital s fixed it.

    mv sites Sites
    
    0 讨论(0)
提交回复
热议问题