Strange error in rails - missing helper

后端 未结 17 575
不思量自难忘°
不思量自难忘° 2020-11-30 01:46

I am not sure , but this might be associated with a crashed computer. After restarting (after the crash) I get a missing helper error where the helper name is wrong. Switc

相关标签:
17条回答
  • 2020-11-30 02:17

    I had the same problem, but NO user-created directories that had uppercase letter in them... only /Users.

    I tried upgrading to ruby 2.2.1 - this did not fix it.

    I very hesitantly fixed it by doing the same case-sensitive "fix" on my /Users directory:

    cd /
    sudo mv Users users1
    sudo mv users1 users
    

    I have yet to see if that breaks anything else....

    0 讨论(0)
  • 2020-11-30 02:18

    The problem seems to have been introduced in the latest version of ruby, ruby 2.2.0.

    Try this experiment:

    in rails console/or irb:

    [1] pry(main)>File.expand_path ("./") 
    => "/users/xxxx/Sites/xxxx"
    

    and in the terminal window:

    ]$ pwd
    /users/xxxx/sites/xxxx
    

    See the different case? If you get that, then deep in the bowels of active support a regex goes south. One fix is to remove the "sites" directory and recreate. It might also work to rename the sites directory using the finder, as rename it to "foobar" and then back to "sites".

    hth.

    (from this page in Japan) http://translate.google.com/translate?hl=en&sl=ja&u=http://d.hatena.ne.jp/jiikko/20150108&prev=search

    And when I was debugging this with another person, it was enough to have a mixed case directory name in the path. We renamed it to 'farknerd' and then back the original, except all lower case, and it worked.

    0 讨论(0)
  • 2020-11-30 02:19

    This had been bugging me for so long. I didn't find any joy with attempting to rename the files or directories.

    I did, however, find a really easy fix. Simply go into the main directory of your project and run 'bundle install'. It installed all of the gem dependencies (without overwriting any data I had written) which effectively fixed any issues.

    Opened up the rails server and hurrah, normal service was resumed.

    Hope that helps!

    0 讨论(0)
  • 2020-11-30 02:22

    Following Rob's instructions, I found it necessary to rename + lowercase every folder in the filepath up to 'Users' before my error went away.

    0 讨论(0)
  • 2020-11-30 02:23

    The problem..

    For me the same issue with the error

     "missing helper file app/helpers/application_helper.rb_helper.rb"
    

    The app was located in a directory tree

    /Users/grantsayer/Documents/Work/recipes
    

    So on conducting the test to show the path, both from within the terminal and within the ruby environment I found the following:

    1. Ruby environment

    Grants-MacBook-Pro:Recipes grantsayer$ irb

    2.2.0 :001 >

    2.2.0 :002 > File.expand_path("./") => "/Users/grantsayer/Documents/Work/Recipes"

    2. Unix Terminal

    Grants-MacBook-Pro:Recipes grantsayer$ pwd /Users/grantsayer/Documents/Work/recipes

    At this stage running the rails server and navigating to http://localhost:3000 resulted in the error about a missing application helper. This error, as others have described, appears to be a bug within ruby causing case conversion on the file path.

    I solved the issue by renaming the recipes folder to Recipes so that the ruby environment check in irb matched the local filesystem.

    0 讨论(0)
  • 2020-11-30 02:24

    I had the same issue using powder gem. Here is how I fixed it:

    powder unlink
    powder link
    
    0 讨论(0)
提交回复
热议问题