I'm unable to duplicate your problem with Rails 2.3.5.

I just learned that `config.gem "amatch"` automatically requires the library
with the same name, so you shouldn't need to put `require "amatch"` anywhere
in the application. Same goes for Rails 3 and Bundler.

I just whipped up a simple scaffold application, here's what it looks like
(Maybe this will help(?)--I'm not very familiar with how Amatch works, maybe
I'll look into that):


# config/environment.rb
config.gem "amatch"

# app/models/post.rb
class Post < ActiveRecord::Base
  include Amatch
end

# app/controllers/posts_controller.rb
class PostsController < ApplicationController
  def index
    @posts = Post.all

    m = Post::Sellers.new("hello")

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @posts }
    end
  end
end


This doesn't throw any errors for me.


Phillip Ridlen
@philtr


On Sat, Aug 14, 2010 at 5:01 PM, Ze Ca <[email protected]> wrote:

> Hi Philip,
>
> I put the amatch gem in the environment.rb file as config.gem 'amatch'
>
> I tried the require 'amatch' in line 1 in each of my models and got this
> error:
>
> MissingSourceFile in PostsController#show
>
> no such file to load -- amatch
>
> Thank you!
>
> Phillip Ridlen wrote:
> > I believe you've included it in the correct place, but where is your
> > `require 'amatch'`?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to