使用 RVM 创建 Gemfile
我有一个 Rails 2.3.8 应用程序。我刚刚安装了 RVM,显然一切正常(我创建了一个非常简单的 Rails 项目来检查 Rails 和 mysql 是否运行正常)。
我现在正在尝试创建一个 Gemfile...但我面临 Thinking-Sphinx 的问题。这是我的 Gemfile 的当前版本:
source :rubygems
source "http://rubygems.org"
source :rubyforge
source "http://gems.rubyforge.org"
source :gemcutter
source "http://gemcutter.org"
gem 'SystemTimer', :platforms => :ruby_18
gem "rails", "2.3.5"
# make sure to run "bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config" in terminal before running "bundle install" as per documentation in http://gembundler.com/man/bundle-config.1.html
gem "mysql"
gem "tlsmail"
gem 'delayed_job'
gem 'will_paginate', '~> 2.3.11'
gem "chronic"
gem "nokogiri"
gem "sphinx", '0.9.10.2122'
gem 'thinking-sphinx', '< 2.0.0', :require => 'thinking_sphinx'
gem 'ts-delayed-delta', :require => 'thinking_sphinx/deltas/delayed_delta'
gem "mini_magick"
gem "faker"
gem "populator"
gem "rspec"
gem "geokit"
gem "geokit-rails"
我的 Rakefile 是:
require 'thread'
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
require 'thinking_sphinx/tasks'
require 'thinking_sphinx/deltas/delayed_delta/tasks'
begin
gem 'delayed_job', '~>2.0.3'
require 'delayed/tasks'
rescue LoadError
STDERR.puts "Run `rake gems:install` to install delayed_job"
end
当我运行时
rake ts:配置
我收到以下错误消息:
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
Generating Configuration to /Users/alex/Sites/myproject/config/development.sphinx.conf
rake aborted!
uninitialized constant ThinkingSphinx::Deltas::DelayedDelta
Tasks: TOP => ts:config => thinking_sphinx:configure
(See full trace by running task with --trace)
我已经尝试了不同的事情几个小时,但找不到如何解决问题...希望得到一些帮助!
I have a rails 2.3.8 app. I just installed RVM, and apparently things are working ok (I created a very simple rails project to check that rails and mysql were running ok).
I am now trying to create a Gemfile... but am facing a problem with Thinking-Sphinx. Here is the current version of my Gemfile:
source :rubygems
source "http://rubygems.org"
source :rubyforge
source "http://gems.rubyforge.org"
source :gemcutter
source "http://gemcutter.org"
gem 'SystemTimer', :platforms => :ruby_18
gem "rails", "2.3.5"
# make sure to run "bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config" in terminal before running "bundle install" as per documentation in http://gembundler.com/man/bundle-config.1.html
gem "mysql"
gem "tlsmail"
gem 'delayed_job'
gem 'will_paginate', '~> 2.3.11'
gem "chronic"
gem "nokogiri"
gem "sphinx", '0.9.10.2122'
gem 'thinking-sphinx', '< 2.0.0', :require => 'thinking_sphinx'
gem 'ts-delayed-delta', :require => 'thinking_sphinx/deltas/delayed_delta'
gem "mini_magick"
gem "faker"
gem "populator"
gem "rspec"
gem "geokit"
gem "geokit-rails"
And my Rakefile is:
require 'thread'
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
require 'thinking_sphinx/tasks'
require 'thinking_sphinx/deltas/delayed_delta/tasks'
begin
gem 'delayed_job', '~>2.0.3'
require 'delayed/tasks'
rescue LoadError
STDERR.puts "Run `rake gems:install` to install delayed_job"
end
When I run
rake ts:config
I get the following error message:
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
Generating Configuration to /Users/alex/Sites/myproject/config/development.sphinx.conf
rake aborted!
uninitialized constant ThinkingSphinx::Deltas::DelayedDelta
Tasks: TOP => ts:config => thinking_sphinx:configure
(See full trace by running task with --trace)
I've been trying different things for a couple hours but can't find how to solve the problem... would love some help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
bundle exec rake ts:config
这将使用您在 Gemfile 中指定的版本。
Try
bundle exec rake ts:config
This will use the version you specified in your Gemfile.
我的建议是不要使用 RVM。这是一个好主意,但实施得很差。如果您像我一样需要多个 ruby 版本,那么为每个版本创建别名就不那么麻烦了。
RVM 有时会导致问题,但使用别名却不会。
My advice is to not use RVM. It is a good idea, but poorly implemented. If you need multiple ruby versions like me it is far less of a hassle to just create aliases for each one.
RVM causes issues from time to time, using aliases never does.