> trying to follow your conjecture: you're saying some versions of rails
> may automatically require all gems configged in env.rb and others may
> not? i'm guessing that's not what you're saying because this is one
> specific file within the gem that wasn't hit. how would the job.rb
> file have been found? does rails/rake recursively require/load all .rb
> files under some dirs?

No, you got it right the first time - I would expect Rails to call  
require on the :lib options in the gems in environment.rb, and  
'thinking_sphinx/deltas/delayed_delta' will then require  
'thinking_sphinx/deltas/delayed_delta/job'.

However, there is also an explicit require for 'thinking_sphinx/deltas/ 
delayed_delta' in the tasks file for that gem, when the delayed_delta  
task is invoked (but on the other hand, I don't have any explicit  
requires for 'thinking_sphinx', just the :lib option). So really, the  
Job class should definitely exist without your extra require...

And as it turns out, my test app is using Rails 2.3.2 as well... so  
I've no idea what's going on :)

-- 
Pat

On 06/12/2009, at 11:00 AM, Brian Percival wrote:

> # environment.rb
>
> RAILS_GEM_VERSION = '2.3.2'
>
>  config.gem 'thinking-sphinx', :lib => 'thinking_sphinx', :version =>
> '1.3.8',
>      :source => 'http://gemcutter.org'
>
>  config.gem 'ts-delayed-delta', :lib => 'thinking_sphinx/deltas/
> delayed_delta',
>      :source => 'http://gemcutter.org', :version => '1.0.2'
>
>
>
> # Rakefile (i'll show you if you promise to point but not laugh at
> anything that makes me look like an idiot ;)
>
> # ...
>
> # for thinking sphinx: handle LoadError so you can run rake to install
> gems
> begin
>  require 'thinking_sphinx'
>  require 'thinking_sphinx/tasks'
>  require 'delayed/tasks'
>  require 'thinking_sphinx/deltas/delayed_delta/tasks'
>  require 'thinking_sphinx/deltas/delayed_delta/job'
> rescue LoadError
> end
>
> ---
>
> $ gem list t
>
> *** LOCAL GEMS ***
>
> thinking-sphinx (1.3.8)
> ts-delayed-delta (1.0.2)
>
> $ gem list rail
>
> *** LOCAL GEMS ***
>
> rails (2.3.2)
>
> $ ruby -v
> ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
>
> ---
>
> trying to follow your conjecture: you're saying some versions of rails
> may automatically require all gems configged in env.rb and others may
> not? i'm guessing that's not what you're saying because this is one
> specific file within the gem that wasn't hit. how would the job.rb
> file have been found? does rails/rake recursively require/load all .rb
> files under some dirs?
>
> thanks!
> bp
>
>
> On Dec 5, 3:24 am, Pat Allan <[email protected]> wrote:
>> Hi Brian
>>
>> I find it works fine for me without that require - how do you have TS
>> installed? What are the lines you've got in your environment.rb file
>> for the TS-related gems? Also, what version of Rails are you using?
>> (Perhaps that's the reason for these differences - it wouldn't
>> surprise me if gem listings are included for rake tasks in some
>> versions of Rails, and not others).
>>
>> And you're right about the namespacing being dodgy - I'll have to fix
>> that up at some point.
>>
>> --
>> Pat
>>
>> On 04/12/2009, at 8:13 PM, Brian Percival wrote:
>>
>>
>>
>>> I needed to add one more require to my Rakefile to get things to  
>>> work:
>>> require 'thinking_sphinx/deltas/delayed_delta/job'
>>
>>> I posted about it in this thread, but I'm a new member of the  
>>> group so
>>> I'm still moderated:http://groups.google.com/group/thinking-sphinx/ 
>>> browse_thread/thread/e...
>>
>>> Please provide feedback if this is a no-no or I'm hiding another
>>> underlying problem.
>>
>>> Thanks,
>>> bp
>>
>>> On Dec 2, 1:26 am, keldelice <[email protected]> wrote:
>>>> Hi Pat thanks it much more clear. However I think you need in
>>>> Rakefile
>>>> require 'thinking_sphinx' and require 'thinking_sphinx/tasks' and  
>>>> if
>>>> using delayed deltas (and delayed job for other stuff) you need
>>>> require 'delayed/tasks'
>>>> require 'thinking_sphinx/deltas/delayed_delta/tasks'
>>
>>>> Cheers,
>>>> Cyrille
>>
>>>> On 2 déc, 02:39, Pat Allan <[email protected]> wrote:
>>
>>>>> Hi All
>>
>>>>> The last few weeks have had some pretty key changes to how to
>>>>> install
>>>>> Thinking Sphinx, so if you're upgrading, you may hit some  
>>>>> issues...
>>>>> here's a quick run through:
>>
>>>>> If you're using a gem, here's the Right Way of adding it to your
>>>>> environment.rb:
>>
>>>>>    config.gem 'thinking-sphinx', :lib => 'thinking_sphinx'
>>
>>>>> Do not use the thinking-sphinx-099 gem - Thinking Sphinx will now
>>>>> figure out what version you have automatically, and all
>>>>> functionality
>>>>> is in the one gem.
>>
>>>>> If you're using delayed or datetime deltas, these are now separate
>>>>> gems:
>>
>>>>>    config.gem 'ts-delayed-delta', :lib => 'thinking_sphinx/deltas/
>>>>> delayed_delta'
>>>>>    # or
>>>>>    config.gem 'ts-datetime-delta', :lib => 'thinking_sphinx/ 
>>>>> deltas/
>>>>> datetime_delta'
>>
>>>>> If you're using delayed delta, you also need to add delayed job to
>>>>> that list as well:
>>
>>>>>    config.gem 'delayed_job'
>>
>>>>> For no/normal delta approaches, all you need in your Rakefile
>>>>> (beyond
>>>>> the default lines) is this line:
>>
>>>>>    require 'thinking_sphinx/tasks'
>>
>>>>> If you're using one of the delta gems as well, then you'll need to
>>>>> require their tasks too:
>>
>>>>>    require 'thinking_sphinx/deltas/delayed_delta/tasks'
>>>>>    # or
>>>>>    require 'thinking_sphinx/deltas/datetime_delta/tasks'
>>
>>>>> If you're using a plugin, you just need to install it as usual,  
>>>>> and
>>>>> not add any custom requires to your environment file (the  
>>>>> temporary
>>>>> 0.9.9 requires are no longer valid). You will need to install the
>>>>> delta gems if you were using those delta approaches, though.
>>
>>>>> And of course, if you get stuck, just let me know via the list,
>>>>> email,
>>>>> or twitter.
>>
>>>>> Cheers
>>
>>>>> --
>>>>> Pat
>>>>> e: [email protected]      || m: +614 1327 3337
>>>>> w:http://freelancing-gods.com|| t: twitter.com/pat
>>>>> bounce:http://trampolineday.com|| skype: patallan
>>
>>> --
>>
>>> You received this message because you are subscribed to the Google
>>> Groups "Thinking Sphinx" 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 
>>> athttp://groups.google.com/group/thinking-sphinx?hl=en
>>> .
>
> --
>
> You received this message because you are subscribed to the Google  
> Groups "Thinking Sphinx" 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/thinking-sphinx?hl=en 
> .
>
>

--

You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en.


Reply via email to