ruby on rails unable to find interface that appears to be proplery defined - ruby-on-rails

I'm brand new to ruby on rails and trying to run an application developed by others. I downloaded it from SVN it running yesterday, but today when I try to run it the first attempt to access the site's home page I get the message:
expected .../app/helpers/interface/table_helper.rb to define Interface::tableHelper.
.../lib/active_support/dependencies.rb:452:in 'load_missing_constant'
This file exists, and properly defines the tableHelper interface. Since I was able to run the program when I was setting it up yesterday, and others can run it without issue, I assume the problem I'm seeing is caused by an incorrectly set up environment rather then bad code somehow.
Can anyone suggest what I might try to figure out why rails can't seem to detect a properly defined interface?

If you were able to run the program once, perhaps something got screwed up? Have you made any changes to the code?
Alternatively, try stopping and restarting the server.
Also: what's the application? Maybe we can look at the codebase...

Related

Issue with Rails Generator Building a Plugin

I am building a Rails plugin for an application at work.
I want to extract logic that was used in multiple locations, but implemented slightly differently, and add new features needed without doing it 2-3 times over.
I've never build a gem, but according to what I was reading it is possible to use rails generate.
However this has not been the case for me.
Running rails g model Something stuff:type:
First interesting thing is that it is generating mini test stuff when I explicitly told the plugin not to use mini test (using Rspec).
Then looking in my folder structure for the plugin, no db/ folder, nothing added to app/models/, and no test/ folder:
Running the command a second time reveals to me that the files are indeed created:
My questions are:
Where is this stuff going? Can I even find out?
Has anyone encountered something similar? Is it due to a misconfiguration, or bug? Essentially, what's happening?
I would truly appreciate any advice or suggestions!
EDIT #1
Forgot to mention that I checked within the spec/dummy application in case things were being created there, and it is still empty as I left it.
EDIT #2
So I found where the files were by using the find command:
And yeah it added the files to my home folder...
At least now I can just paste them in the right location, but obviously this is bizarre and I'd like to get this resolved, figure out what is going on.
Okay so turns out that yes you may use Rails Generators when building a gem. Also, the generated files will not be placed inside the dummy application unless you are in that directory.
Everything is working as expected on a different computer.
That stuff is going into dummy app that is usually located in test/dummy. In your case, it seems to be located in specs/dummy.
Yeap and nope. That's not misconfiguration.

how to debug web server on RoR?

I currently have a problem with a project.
it freezes before it shows the "Started GET ...." seems like it hits an infinite loop.
now i dont really have much experience with debuggers in ROR, can anyone recommend anything i can use to trace the exact origin of the problem. if i can get an error code somewhere then i might be able to fix it.
currently i am using webrick, i tried thin and it gave the exact same error.but i am willing to use anything to find the exact origin of this error.
it seems to be related to the project because all other projects works fine on my environment.
Take a look at the Rails guide on debugging.
Also try running the Rails console ("rails c"); if you can get to a command prompt at all that means that the issue is not in loading the Rails environment (e.g. a problem in application.rb) but is somewhere in the process of making a web request. If there's a failure it may give you a better error message.

Passenger "No such file to load" error for Model

I'm having a problem with deploying a Rails 3 app to a Passenger/Apache2/RVM server running Ubuntu 11.10.
I'm getting the error:
A source file that the application requires, is missing.
...
Error message: No such file to load -- Goal
Exception class: LoadError
Goal is one of my Rails Models.
I've seen a lot of people with a similar error message, but their issues seem to relate to missing bundles/gems - not model files! Their problems were resolved by ensuring permissions were set up correctly, so to that end I've got:
Apache running as www-data, as is Passenger. RVM is installed as www-data and I've chown'd the entire web app directory to www-data.
I've been wrestling with this for some time now and am really out of ideas - if anyone has any suggestions I'd be very grateful!
You might probably have the file structure of your Rails app wrong. Are you sure you have the "goal.rb" file within {your_app_root_url}/app/models/ ?
To me, if I am seeing the error when you view the app in browser, it seems like your rails app and passenger(with apache2) are working fine. The other possibility is you might be looking at wrong app folder which passenger is set up to.
It's hard to tell what's wrong. Please provide more details of how you set up your passenger with your rails app directory. Also it would help if you could show what's inside your app (app structure) and what's inside goal.rb model file.
Well I've solved it. Turned out that a work around for a problem with yaml encoded model archives (i.e. an explicit require of Goal) in a completely unrelated Model was causing the error to appear. Looks like it only rears its head in production - probably due to the differences between the class loaders used in development vs. production.
Tough one to find... the stack trace didn't include a reference to where the problem actually was!

Rails server running in command prompt causing conhost.exe to crash

I have a Rails application that requires a bunch of environment stuff to get set up, and right now the easiest way for me to do it is to run a batch file to configure the environment and then launch the server from the command prompt. (Perhaps one day I will bite the bullet and transcribe all of the various environment variables into the project config, but I'd rather not...)
But when I do this, I occasionally manage to crash conhost.exe! It does not seem like I should be able to do this. Stranger still, it seems to happen most often if I access certain records in the application. I can't imagine it could crash if there were too much console output???
I am also having mscvrt-ruby.dll crashes, although I may have resolved those by doing some gem finagling. The conhost issue may or may not be related, I'm not sure. But if I launch the server from within RadRails, I don't seem to get these issues (the app doesn't completely work because of the missing environment stuff, but it seems much more stable).
Technicals: Windows 7, Rails 2.3.5, Ruby 1.93, Mongrel 1.2.0pre, uh, not sure what else...
Thoughts?

Rails Routing Error on static single image

I'm getting a rails routing error for a brand new image I just added. The other images in the folder all work perfectly (/public/images/%f requested at /images/%f) yet this one produces a routing error. I've checked file permissions and it's not that.
Anybody know what might cause this? I'm using the development env so caching is off and I've verified it is!
Thanks,
Jay
Ok, rebooting my vagrant VM fixed it. Don't ask me why because I don't know and it doesn't make logistical sense, in the dev env everything should be reloaded on each request.
I did nothing else except boot the VM again after Zachary asked for some fail code and it was accessible as soon as rails loaded. I spoke to a colleague shortly thereafter and he too had a very similar issue where files were not accessible until after a reboot of the machine and similarly rebooting rails itself didn't do the same job for him either.
Sorry for wasting your time!

Resources