I only have 1 model in my app right now. I have tried several methods of
installation.
1. Tried using bundler adding gem "geokit", "1.5.0" to the Gemfile and
bundle install and bundle pack.
2. Tried Rails::Initializer.run do |config|config.gem "geokit" end with
rake gems:install
3. tried ./script/plugin install git://github.com/andre/geokit-rails.git
none of these work for me. I get the same error.
Here is my model.
require 'geokit'
require 'vendor/plugins/geokit-rails/init.rb'
class Listing < ActiveRecord::Base
acts_as_mappable
end
got my config/preinitializer.rb file
Any ideas?
~Jeremy Woertink
--
Posted via http://www.ruby-forum.com/.
config.gem "geokit"
Craig
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
yeah, I tried that, and it didn't work. (see method #2). I've already
done a google search for that error, and a couple blogs come up that
show methods for fixing it. I've tried their methods, but it hasn't
worked for me.
>
> yeah, I tried that, and it didn't work. (see method #2). I've already
> done a google search for that error, and a couple blogs come up that
> show methods for fixing it. I've tried their methods, but it hasn't
> worked for me.
----
Get rid of these...
require 'geokit'
require 'vendor/plugins/geokit-rails/init.rb'
config/preinitializer.rb file
yeah, I got all the other gems working fine. (rails, mysql, paperclip,
will_paginate, clearance). Just for some reason, I can't get this one to
work. Actually, I take that back. If I hop into console and require
"geokit", then I can use the API directly. The only thing I can't get to
work is acts_as_mappable. It just keeps saying that it's undefined. My
model is Listing, so when I just hop into console and type "Listing" it
throws the error, even if I require 'geokit' first.
config/environment.rb
config.gem "geokit"
'
and in my model...
acts_as_mappable
that's it - nothing more... restart the web server, open a console -
done.
hmm, yeah. It's the weirdest thing. I started a fresh app and tried just
that, and it was a no go. I still get undefined method
acts_as_mappable.... I'm not sure what's going on, but that's for the
help :)
using:
Ruby 1.8.7
Rails 2.3.5
Geokit 1.5.0
OSX 10.5.8
Did you ever get anywhere on this issue? Were you using Bundler at the
time? I just ran into it while setting up an existing application to use
Bundler. Upon disabling Bundler, everything works as before, so I'm
certain it's a Bundler bug... Not sure where to start on it.
Solved it! First, make sure you don't have the geokit-rails plugin
installed. It just confuses Bundler and Rails. Then make sure you
specify in your Gemfile BOTH the geokit gem AND the geokit-rails gem,
something like this:
gem 'geokit', '>= 1.5.0'
gem 'geokit-rails', '1.1.4'
If you're on Rails 3, that should do it. If you're on Rails 2 like me,
you'll need to make sure you follow the instructions on the Bundler
website: http://gembundler.com/rails23.html
Works beautifully for me!