0

我有一个 ruby​​ on rails 2.x 应用程序,并试图通过在应用程序的脚本目录中运行“script -e production”来启动本地服务器。我似乎无法启动服务器。我已经卸载了我所有的 gem 并使用“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]--
> 

编辑:这是我当前的 gem 版本(由捆绑程序安装)。

--[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]--
> 
4

2 回答 2

1

我相信这是由于 mysql 和 mysql2 gem 之间的冲突而引起的。我从我的 Gemfile 中注释掉了 mysql2 gem,并明确添加了 mysql;这似乎解决了这个问题。

于 2013-04-03T18:27:17.960 回答
0

看起来您在尝试使用 Rails 2 时对 Rails 3 有 gem 依赖。您使用的是什么 gem?您可能必须深入研究每个版本,并更具体地了解要使用的版本(以确保它与 Rails 2 一起使用)。

于 2013-04-01T16:23:51.097 回答