Barkin MAD
Barkin MAD

Reputation: 127

Rails Missing helper file application_helper.rb_helper.rb

OS: Windows 10 x64 Rails: 4.2.5.1 Ruby: 2.2.4

Hello, I am running rails on windows and installed it with the Rails Installer. On a fresh generated application I get this error:

Missing helper file helpers/c:/myapp/app/helpers/application_helper.rb_helper.rb

When I create the file named application_helper.rb_helper.rb. The error changes to:

uninitialized constant C

I am creating my own thread for this because every other user who had this issue seems to in a folder called user; mine is not. I assume this is because I am on windows and do not have RVM.

Upvotes: 2

Views: 5380

Answers (3)

neongrau
neongrau

Reputation: 953

The problem is that since Ruby 2.2.x every filesystem is treated like its case-sensitive. Coming from this https://bugs.ruby-lang.org/issues/10700

You can surely use any mix of upper-/lowercase in your path but you must pay 100% attention you stick to that since a single letter written differently behind a cd on a command line or within the working directory of a script will trigger the problem.

e.g. when your Rails app is in a folder named RailsApp: PS C:\>cd RailsApp PS C:\RailsApp>rails c production works just fine.

While PS C:\>cd railsapp PS C:\railsapp>rails c production will fail.

Upvotes: 3

Barkin MAD
Barkin MAD

Reputation: 127

To fix the issue, I renamed the project folder to all lower-case and moved the directory from c:\ to c:\workspace

Upvotes: 7

spickermann
spickermann

Reputation: 106802

I guess that you used the Rails helper method somewhere in your code and that you provided the file's full name and not just the prefix. Something like this:

helper 'application_helper.rb'

What should just be written as:

helper 'application'

Upvotes: 1

Related Questions