我在rails 2.x应用程序上有一个ruby,我试图通过在应用程序的脚本目录中运行“script -e production”来启动本地服务器。我似乎无法让服务器启动。我卸载了所有宝石并使用“bundle install”重新安装它们。以下错误实际上对我来说都不是致命的。有人能够阐明服务器无法加载的原因吗?我试图启动服务器的输出如下:
--[dps@neve]-[/tmp/asapnew/asap/script]--
> ./server -e production
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick
=> Rails 2.3.14 application starting on http://0.0.0.0:3000
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21.
Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus
support for Ruby 1.9's m17n encoding engine.
--[dps@neve]-[/tmp/asapnew/asap/script]--
>
编辑:以下是我目前的宝石版本(由捆绑商安装)。
--[dps@neve]-[/tmp/asapnew/asap]--
> bundle list
Gems included by the bundle:
* actionmailer (2.3.14)
* actionpack (2.3.14)
* activerecord (2.3.14)
* activeresource (2.3.14)
* activesupport (2.3.14)
* builder (3.0.0)
* bundler (1.3.4)
* configatron (2.6.3)
* declarative_authorization (0.4.1)
* fastercsv (1.5.3)
* haml (3.0.4)
* hoptoad_notifier (2.4.7)
* liquid (2.0.0)
* memcache-client (1.8.3)
* mysql2 (0.2.18)
* newrelic_rpm (2.13.4)
* nokogiri (1.4.1)
* paperclip (2.3.1.1)
* pdfkit (0.5.2)
* prawn (0.8.4)
* prawn-core (0.8.4)
* prawn-layout (0.8.4)
* prawn-security (0.8.4)
* preferences (0.4.2)
* rack (1.1.3)
* rails (2.3.14)
* rake (0.8.7)
* ruby_parser (2.0.6)
* sanitize (1.2.1)
* searchlogic (2.4.9)
* sexp_processor (3.2.0)
* slim_scrooge (1.0.11)
* uuidtools (2.1.1)
* version_bumper (0.3.0)
* will_paginate (2.3.12)
* yamler (0.1.0)
--[dps@neve]-[/tmp/asapnew/asap]--
>
答案 0 :(得分:1)
我相信这是因为mysql和mysql2 gem之间的冲突而产生的。我从我的Gemfile中注释掉了mysql2 gem,并明确添加了mysql;这似乎解决了这个问题。
答案 1 :(得分:0)
在尝试使用Rails 2时,看起来你对Rails 3有一个gem依赖。你使用了什么宝石?您可能需要深入了解每个版本并更具体地了解要使用的版本(以确保它适用于Rails 2)。