Reputation: 926
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.
I think it's local on my desktop machine because I recently did some work to the app on my laptop. I pushed from the laptop and app works fine on Heroku and runs local on that machine with zero problems. I added a feature to upload company logo images using Carrierwave, Mini_Magick, and Fog to Amazon S3.
Things I've tried so far: I've deleted the app and git clone it back to this machine. I've tried Brew uninstall/install imagemagick and did all the basics like bundle install, rake db:migrate after I cloned the app. Still no luck..
Here is the error codes I am getting on the page and also the full trace:
AbstractController::Helpers::MissingHelperError in PagesController#dashboard
Missing helper file helpers//users/jamesfend/sites/feedbackz/app/helpers/application_helper.rb_helper.rb
Extracted source (around line #1):
1 class ApplicationController < ActionController::Base
2 # Prevent CSRF attacks by raising an exception.
3 # For APIs, you may want to use :null_session instead.
4 protect_from_forgery with: :exception
Full Trace
actionpack (4.2.0) lib/abstract_controller/helpers.rb:151:in `rescue in block in modules_for_helpers'
actionpack (4.2.0) lib/abstract_controller/helpers.rb:148:in `block in modules_for_helpers'
actionpack (4.2.0) lib/abstract_controller/helpers.rb:144:in `map!'
actionpack (4.2.0) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers'
actionpack (4.2.0) lib/action_controller/metal/helpers.rb:93:in `modules_for_helpers'
actionpack (4.2.0) lib/abstract_controller/helpers.rb:108:in `helper'
actionpack (4.2.0) lib/action_controller/railties/helpers.rb:17:in `inherited'
app/controllers/application_controller.rb:1:in `<top (required)>'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `load'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `block in load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:647:in `new_constants_in'
activesupport (4.2.0) lib/active_support/dependencies.rb:456:in `load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:354:in `require_or_load'
activesupport (4.2.0) lib/active_support/dependencies.rb:494:in `load_missing_constant'
activesupport (4.2.0) lib/active_support/dependencies.rb:184:in `const_missing'
app/controllers/pages_controller.rb:1:in `<top (required)>'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `load'
activesupport (4.2.0) lib/active_support/dependencies.rb:457:in `block in load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:647:in `new_constants_in'
activesupport (4.2.0) lib/active_support/dependencies.rb:456:in `load_file'
activesupport (4.2.0) lib/active_support/dependencies.rb:354:in `require_or_load'
activesupport (4.2.0) lib/active_support/dependencies.rb:494:in `load_missing_constant'
activesupport (4.2.0) lib/active_support/dependencies.rb:184:in `const_missing'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:261:in `const_get'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:261:in `block in constantize'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:259:in `each'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:259:in `inject'
activesupport (4.2.0) lib/active_support/inflector/methods.rb:259:in `constantize'
activesupport (4.2.0) lib/active_support/dependencies.rb:566:in `get'
activesupport (4.2.0) lib/active_support/dependencies.rb:597:in `constantize'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:59:in `controller'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:38:in `serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.0) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.0) lib/action_dispatch/routing/route_set.rb:802:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.6.0) lib/rack/etag.rb:24:in `call'
rack (1.6.0) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.0) lib/rack/head.rb:13:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.0) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.0) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
activerecord (4.2.0) lib/active_record/migration.rb:378:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.0) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
rack (1.6.0) lib/rack/content_length.rb:15:in `call'
rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
/Users/jamesfend/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/jamesfend/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/jamesfend/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Pages Controller
class PagesController < ApplicationController
def dashboard
@title = 'Feedbackz by Amazio Labs'
@header_title = 'Dashboard'
end
def billing
@title = 'Billing & Plans - Feedbackz by Amazio Labs'
@header_title = 'Billing & Plans'
@user = User.find(current_user.id)
end
def contact
@title = 'Contact - Feedbackz by Amazio Labs'
@header_title = 'Contact Us'
end
def faq
@title = 'FAQ - Feedbackz by Amazio Labs'
@header_title = 'Frequently Asked Questions'
end
def invoices
@title = 'Invoices - Feedbackz by Amazio Labs'
@header_title = 'Invoices'
end
def videos
@title = 'Videos - Feedbackz by Amazio Labs'
@header_title = 'Helpful Videos'
end
def schedule
@title = 'Schedule - Feedbackz by Amazio Labs'
@header_title = 'Schedule of Pending Sends'
end
end
Upvotes: 19
Views: 13284
Reputation: 1
I got this error from
rails g controller Name
I just deleted the controller with
rails d controller Name
Then generated it again with lowercase
rails g controller name
Upvotes: 0
Reputation: 41
I get this error while running rails s
on windows powershell but not on cmd.
I sugest using a different CLI.
Upvotes: 1
Reputation: 182
If you are using Windows and Powershell, this issue can occur when running rails s
or rails server
from a directory which has a certain capitalisation in the filesystem, but if you have changed into the directory in Powershell using a different capitalisation.
For example on my Windows filesystem my rails site is located at:
C:/Code/Personal-Website
however I ran the following commands in powershell to start my server:
C:\Users\XXX XXX> cd C:/code/personal-website
C:\code\personal-website> rails s
This case mismatch between where Powershell thinks it is starting the server versus where the server's document root actually is in the filesystem seems to cause the problem, and ensuring that your Powershell location case matches that of the directories in Windows will stop it.
Upvotes: 1
Reputation: 73
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.
Upvotes: 1
Reputation: 659
This isn't really a ruby or Rails bug as it is a flaw in OSX (IMHO) resulting from a design decision made many years ago to maintain compatibility with OS 8.0 (classic MacOS) and provide better compatability with Windows FAT/NTFS. That decision was to implement HFS+ with a case preserving but case insensitive naming schema wherein the following paths are equivalent:
/tmp/CASE_insensitive
/tmp/case_INSENSITIVE
You can read more about this in the following quora post:
Why does OS X choose to have a case-insensitive file system instead of a case-sensitive one?
If you've ever configured an HFS+ filesystem to enforce case insensitivity (you know, to be more compatible with actual *nix filesystems) you may very well come across software that just breaks on OSX because that software has been somewhat carelessly written to assume no case insensitivity (IIRC, some Adobe software had great trouble with HFS+ with case sensitivity).
Try this in the OSX terminal:
prompt>mkdir /tmp/CASE_insensitive
prompt>cd /tmp/case_INSENSITIVE
prompt>pwd
/tmp/case_INSENSITIVE
IMHO, that's pretty messed up. Now, if you're using Pow on your OSX system, when you create the symlink in the ~/.pow
directory to point to your Rails app, be careful of the case. Mis-typing the case here will result in the error noted by the OP. Simply removing and renaming the symlink with the appropriate case will fix this properly.
Upvotes: 0
Reputation: 1265
I also encountered this error. All the solutions here didn't work out and I tried different things. Here's my solution which might help others too:
In my project path there was a folder with a vowel mutation / "Umlaut" (ü, ö, ä etc.). So I changed that and everything worked.
Upvotes: 0
Reputation: 75740
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:
Run irb
and execute this command in your project folder:
File.expand_path("./")
# => "/Users/psy/code/rails_app"
Now exit irb
and run this command in your shell:
$ pwd
# => /Users/Psy/code/rails_app
Compare the two and notice the directory with the case difference, in this case it's Psy
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
Upvotes: 11
Reputation: 13952
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.
Upvotes: 1
Reputation: 1
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 [email protected]
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.
Upvotes: 0
Reputation: 1
I got the same error as above, but it was not due to a case issue. It ended up being due to a combination of things. I had two ruby version managers installed- rvm and rbenv- and I was using an old gem installer. I had to uninstall rvm (How can I remove RVM (Ruby Version Manager) from my system?) and reinstall rbenv (brew reinstall rbenv)and upgrade to the lastest version of ruby. Then I had to update rubygems (gem update --system). Then, reinstalled all gems and a reboot and everything was fixed.
Essentially, my ruby manager was pointing to an old version of ruby and using an outdated version of the gem installer (2.2.0). You might be able to fix things with just an upgrade to rubygems.
It took me a day and a half to get this resolved. Hopefully, this will save someone some time and frustration.
Upvotes: 0
Reputation: 123
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
Upvotes: 4
Reputation: 1608
I found that renaming only the sites folder worked for me just like Zubin pointed out. I did not do the sudo ln command.
mv sites sites1
mv sites1 sites
Upvotes: 3
Reputation: 9712
This worked for me:
cd ~
mv sites tmpsites
mv tmpsites sites
I also did this, but am unsure if it was required:
cd /
sudo ln -s Users users
Oddly, I can't see the lowercase users
symlink, but both ls /users
and ls /Users
work.
Upvotes: 21