Fitnesse: Could not find or load main class - fitnesse

When I run a test I get the below error:
Error: Could not find or load main class C:\GrowthEdition.QA\fitnesse\fitSharp\Runner.exe
The runner is in the specified location.
In the suitesetup I have defined the test runner:
variable defined: TEST_RUNNER=C:\GrowthEdition.QA\fitnesse\fitSharp\Runner.exe
What could be causing this issue, and how can I resolve it?
Many Thanks,
Rahul Dixit

please ignore.
I dont, know what I did differently, but it suddenly started working again.

Related

Is it possible to test Angular without Karma?

I'm pretty new to angular& we already have a working rails-stack with the jasmine-rails.gem - the tests that come with the example-app are not working, as
beforeEach(module('myApp'));
fails with a Can't find variable: module - and I got no idea where module and inject are supposed to be defined: Does anyone have an idea how to set up angular-tests to run standalone/outside of karma?
They come with angular-mocks.js, include that.
Get it at http://code.angularjs.org/

NoMethodError undefined method '-#' NoMethodError in Controller Ruby on Rails

Context:
I pulled the most recent code from the repository and tried to make sure that the changes I was about to push up were going to work with that version of the code. This is a Ruby on Rails application. Also worth noting is the fact that when running the main application that I pulled from on the web, this error does not show up. But if I run my branch or the main branch cloned onto my environment, the error always shows up for every url I try. So it is on my end.
Problem:
As soon as I go to localhost:3000, I get the following error:
NoMethodError in HomeController#index
undefined method `-#' for #<ActionDispatch::Response:0x64fd460>
What I've Tried:
I have asked my question on the #rubyonrails IRC channel and nobody was able to determine what was going on through the Full Trace (I haven't posted it here because I wasn't sure what was the best way to do that on here; it didn't look very good in the code block or block quote). I have looked at my HomeController's index method, which is defined as such:
def index
#groups = #current_user.groups
#things = Thing.where(:group_id => #groups.map{|e|e.id})
end
I have also Googled around and haven't found what I need to fix the problem.
What I've Learned So Far:
-# is an operator. Some people may receive a similar error in assuming that Ruby has the shortcut to
variable = variable + 1
that a lot of other languages have:
variable++
Here is an example of that case: Undefined method `+#' for false:FalseClass (NoMethodError) ruby
Question:
Does anyone have any further suggestions on how to find the issue here? Also, if I could easily put the Full Trace on here, formatted in an aesthetically pleasing manner, would someone tell me how? I'm at a loss with this one :(
Update (2/8/2013):
It seems that the issue does not necessarily reside in the HomeController nor home/index.html.erb View. I have attempted to access ANY url with a valid action and the same error occurs with "NoMethodError in..." changing to the corresponding [...]Controller#index.
Update (2/9/2013):
Since this error happens no matter what url I try to navigate to, I decided to look in the routes.rb file in the config folder. I ran my server through rubymine instead of the command line this time, which made it a little easier to read for me. I started looking through all the spit out and I noticed an interested line that consisted of:
["private-key looking thing"] [127.0.0.1] Started GET "/" for 127.0.0.1 at 2013-02-09 18:20:52 -0700
It seems like there is a syntactical error in routes.rb (that's my best guess at this point). This does not explain why this only is an issue on my local environment with the same code sets, but what else do I have to go off of?
Does anyone have any suggested things to be on the look out for while I sift through this file? Not really sure what to be looking for as far as errors are concerned. Rubymines inspection stuff converted all my double quotes to single quotes and doesn't really have anything else to complain about.
Thanks in advance,
Jake Smith
I am guessing it might as well be an syntactical error in the corresponding view page Home/index.html.haml .. I am suspecting there is unintended '-' in front of variable call. I tried to simulate a similar scenario in my rails platform and see following page on browser
undefined method `-#' for false:FalseClass
Correct lines of code
%h1 All Movies
= "filtervalue=#{#isFilterOld}"
= "Sortvalue=#{#isSortOld}"
Edited to simulate the error (observe the - in front of isFilterOld variable)
%h1 All Movies
= "filtervalue=#{-#isFilterOld}"
= "Sortvalue=#{#isSortOld}"
I have fixed the issue!
What fixed it:
Go to the directory where your gems are (for me that was C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1)
Delete all gems except for bundler
Make sure you delete the gems from the /cache/, /gems/, and /specifications/ folders (I just deleted them from the /gems/ folder at first and bundle install indicated that it could still find the gems)
Run bundle install
Further Inquiry:
Does anybody have any idea why this worked? I don't know if at this point I can narrow down which gem was causing the issue because the app is working now (I can visit all the urls with corresponding views). If the issue comes up again, I will delete gems one by one to nail down which one was at least causing the issue for me. But if anyone has any insight on this, a more detailed answer would be greatly appreciated by many more people than just me, I think. Thanks to all who helped thus far!

Undefined Method errors on basic AR and AS methods when running threaded with Sidekiq on Heroku

I am getting a couple different errors at a particular line of code in one of my models when running in Sidekiq-queued jobs. The code in question is:
#lookup_fields[:asin] ||= self.book_lookups.find_by_name("asin").try(:value)
I either get undefined method 'scope' for #<ActiveRecord::Associations::AssociationScope:0x00000005f20cb0> or undefined method 'aliased_table_for' for #<ActiveRecord::Associations::AliasTracker:0x00000005bc3f90>.
At another line of code in another Sidekiq job, I get the error undefined method 'decrypt_and_verify' for #<ActiveSupport::MessageEncryptor:0x00000007143208>.
All of these errors make no sense, as they are standard methods of the Rails runtime support libraries.
The model in question has a :has_many association defined for the "book_lookups" model, "name" and "value" are fields in the "book_lookups" model. This always happens on the first 1-3 records processed. If I run the same code outside of a Sidekiq job, these errors do not occur.
I cannot reproduce the error on my development machine, only on production which is hosted at Heroku.
I may have "solved" the first set of errors by putting the code `BookLookup.new()' in an initializer, forcing the model to load before Sidekiq creates any threads. Only one night's work to go on, so we'll have to see if the trend continues...
Even if this solves the immediate problem, I don't think it solves the real underlying issue, which is classes not getting fully loaded before being used. Is class-loading an atomic operation? Is it possible for one thread to start loading a class and another to start using the class before it is fully loaded?
I believe that I have discovered the answer: config.threadsafe!, which I had not done. I have now done that and most if not all of the errors have disappeared. References: http://guides.rubyonrails.org/configuring.html, http://m.onkey.org/thread-safety-for-your-rails (especially the section "Ruby's require is not atomic").

Actsaswizard Rails Plugin

I'm having a problem implementing the example in the actaswizard readme, and I was wondering if my error would be obvious to anyone here.
My controllers, models, and migrations are exactly as shown here: https://github.com/adkron/actsaswizard
My routes are as follows:
match 'test' => 'employees#new'
resources :employees
However when I navigate to localhost/test I recieve the following error:
NoMethodError (undefined method state' for #<Employee:0x00000001c22ad0>):
app/controllers/employees_controller.rb:10:inedit'
Does anyone recognize this error, or have any advice on how to get around it? Thanks in advance for any help! In addition, if you know of any good guides or additional examples using this plugin I'd be grateful for them as well.
I think that the actsaswizard uses the AASM (acts as state machine) to navigate you through the steps. That is why you need to specify a field "state" for the model that actsaswizard! This means that you must run a migration that makes a column named state of string type. Let me know if that worked!

Symfony "cannot fetch TableMap" error when using propel:build-all

Cannot fetch TableMap for undefined table: order_product. Make sure you have the static MapBuilder registration code after your peer stub class definition.
Even if I erase the entire schema, clear the cache, and delete everything but "vendor" in the lib folder, I still get the error. I also get the error when doing propel:build-filters or propel:build-forms.
Thanks for your help in advance!
Turns out I had defined a class with the same name as one of the models. Whoops.

Resources