metasearch undefined search method - ruby-on-rails-3

I am working on a rails 3 app, I am trying to use the meta_search gem.
After adding the gem to the GemFile and running bundle install, it seems that there is no search method.
undefined method `search' for #<Class:0x00000104134458>
I am using something similar to the examples:
#search = Bill.search(params[:search])
#bills = #search.all
Anyone experienced this before?

Well it seems that the problem was between the chair and the keyboard.
I have forgotten to restart the server. After doing so it worked flawlessly.

Related

Sinatra and PostgreSQL - running the entire database and app

I have been struggling with rerunning my apps from MAC OS to my windows OS. I have never liked databases. Anyway, the thing is that I cannot even load up my seeds. It looks like it cannot run the pg gem methods. Here's my error
:in `ensure in run': undefined method `close' for nil:NilClass (NoMethodError)
here's the code the method gets stuck on
require_relative('../models/collection')
require_relative('../models/product')
require('pry')
Product.delete_all()
Collection.delete_all()
fw2015 = Collection.new({
'name' => 'Fall Winter 2015/2016'
})
fw2015.add()
I am pretty sure that it's something with postgres. Thank you for your help
This is a gem issue, not a PostgreSQL issue. It is probably relating to the fact that there are binary portions of the gem and they may not be building right. So you need to make sure that you have the PostgreSQL client libraries and header files installed, and that you have all necessary compilers.
Try uninstalling and re-installing the gem and see what errors and warnings show up.

paper trail gem - undefined local variable or method has_paper_trail

I am using the latest version of paper_trail gem (2.7.1) After the gem installed and table created I have added "has_paper_trail" in my model and end up with getting "undefined local variable or method has_paper_trail". I tried even with lower versions but still getting the same error.
This is a silly mistake as we need to restart the server after gem installation.
Newbies like me often makes such mistakes. Full credit to Thomas for the kind information.

no such file to load -- map_by_method

This question was asked before here, but can't say that the answer helps me. I am using Rails 3.1.3. When I run rails console on my local dev machine, I get the following message:
no such file to load -- map_by_method
The message doesn't prevent the irb session from launching, so it's benign. But I'd like to get rid of it. At one point in time I had the map_by_method gem installed, but I removed it from the Gemfile and gemset -- yet the message still appears. Any idea how to vanquish it?
there might be some causes for this:
there might be some other gem which has it as a dependency
you might have a require 'map_by_method' in your code
you might have a require in your .irbrc
the .irbrc can be located in your user home or in the current working directory.
have a look at an example .irbrc here: http://matthewhutchinson.net/2010/9/19/rails-3-bash-aliases-and-irbrc-configs
Probably the gem map_by_method has done some permanent changes on your system. Try re-installing it. It should fixed your problem. Same thing happened to me once. If it doesn't, try specifying it in development section of gemfile.

Ruby-on-rails gem failing for "where" condition of meta_where

I have a question about what is probably a gems problem, but may be meta-where. I used gems to install meta_where-1.0.4, and the response was that I succeeded and the uri for meta_where was provided, but when I tried a where-condition in the search method of a controller, similar to this example that meta-where provides:
Person.where(:skill_set.matches => 'Hello%'
an error was reported:
"undefined method 'matches' for :skill_set:Symbol"
It's as if the gem's methods aren't being accessed. I tried using "require" but that didn't help.
I'm using Windows XP, Firefox, Ruby 1.9.2.
What do I need to do?
Thanks, Barney
I assume you have run the migrations and there is a skill_set attribute in the person table: you don't need require. Just add 'gem meta_where' to your Gemfile and then run 'bundle install'.

Devise RPX Connectable error undefined method user_session_url

I am trying to install the devise_rpx_connectable gem functionality into my application. Everything seemed to install fine but when I try to call
<%= link_to_rpx "Signin using RPX!", user_session_url %>
I get an undefined method error on user_session_url
Any ideas on what is causing this?
It turns out I had messed up on the initial generation of the devise model. I backed out and re-did it and everything started to work.