Permalink
Browse files

Rails 3 details.

  • Loading branch information...
1 parent 8bfb321 commit 49f17403f940eaaab9626d6f1302501e431a846a @pat pat committed Jul 2, 2010
Showing with 48 additions and 0 deletions.
  1. +2 −0 ts/en/index.textile
  2. +2 −0 ts/en/installing_thinking_sphinx.textile
  3. +44 −0 ts/en/rails3.textile
View
@@ -5,6 +5,8 @@ title: Home
h2. Thinking Sphinx
+*Using Rails 3?* Thinking Sphinx 2 (currently a prerelease) supports Rails 3 only - "here's the lowdown on how to get it set up":rails3.html.
+
h3. What?
A concise and easy-to-use Ruby library that connects ActiveRecord to the "Sphinx":http://sphinxsearch.com search daemon, managing configuration and searching.
@@ -5,6 +5,8 @@ title: Installing Thinking Sphinx
h2. Installing Thinking Sphinx
+*Please note:* Using Rails 3? You'll want to read "the new instructions for that":rails3.html.
+
There's a few different ways you can get Thinking Sphinx installed into your web application. I *highly recommend* installing as a gem (and indeed, if you're using Merb, then you'll have to use the gem). If you're using Rails and prefer a plugin, read through the options further down the page.
h3. As a Gem
View
@@ -0,0 +1,44 @@
+---
+layout: ts_en
+title: Rails 3
+---
+
+h2. Using Thinking Sphinx with Rails 3
+
+Not much has changed - it's really just installation that is a little different. Also: polymorphic associations can't currently be used in field or attribute definitions. This will be fixed at some point.
+
+h3. Installing via Bundler (as a Gem)
+
+Firstly: the latest gem is a prerelease, so you'll need to install it using the @--pre@ flag:
+
+{% highlight sh %}
+gem install thinking-sphinx --pre
+{% endhighlight %}
+
+The 2.x releases of Thinking Sphinx will only support Rails 3 - not Rails 2 or earlier. So be careful with managing gem dependencies across multiple Rails versions. It may be worth looking at "RVM":http://rvm.beginrescueend.com/.
+
+In your Gemfile, you'll need to add the following:
+
+{% highlight ruby %}
+gem 'thinking-sphinx', '2.0.0.rc1', :require => 'thinking_sphinx'
+{% endhighlight %}
+
+Of course, you can point directly to the Git repository if you so desire - just make sure you're referencing the rails3 branch:
+
+{% highlight ruby %}
+gem 'thinking-sphinx',
+ :git => 'git://github.com/freelancing-god/thinking-sphinx.git',
+ :branch => 'rails3',
+ :require => 'thinking_sphinx'
+{% endhighlight %}
+
+You do _not_ need to put the extra @require@ statement in your Rakefile - Rails 3 can determine this automatically (well, when Thinking Sphinx tells it to).
+
+h3. Installing as a Plugin
+
+Things are even simpler if you want Thinking Sphinx installed as a plugin, instead of managed by Bundler - just run the following shell command from within your Rails app:
+
+{% highlight sh %}
+script/rails plugin install \
+ git://github.com/freelancing-god/thinking-sphinx.git
+{% endhighlight %}

0 comments on commit 49f1740

Please sign in to comment.