简体   繁体   English

Rails 2.x服务器无法启动

[英]Rails 2.x server failing to start

I have a ruby on rails 2.x application and am trying to start the local server by running "script -e production" inside of the application's script directory. 我在Rails 2.x应用程序上有一个ruby,并且正在尝试通过在应用程序的脚本目录内运行“ script -e production”来启动本地服务器。 I can't seem to get the server to start. 我似乎无法启动服务器。 I have uninstalled all of my gems and re-installed them using "bundle install". 我已经卸载了所有的gem,并使用“捆绑安装”重新安装了它们。 None of the following errors actually look fatal to me. 以下任何错误对我而言实际上都不是致命的。 Would somebody be able to shed some light on why the server is failing to load? 有人能够阐明为什么服务器无法加载吗? The output of my attampting to start the server is as follows: 我启动服务器的配置输出如下:

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

Edit: Here are my current gem versions (installed by the bundler). 编辑:这是我当前的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]--
> 

I believe this was arising because of a conflict between the mysql and mysql2 gem. 我相信这是由于mysql和mysql2 gem之间的冲突引起的。 I commented out the mysql2 gem from my Gemfile, and explicitly added mysql; 我从Gemfile中注释掉了mysql2 gem,并显式添加了mysql。 this seems to have fixed the problem. 这似乎已经解决了问题。

It looks like you have a gem dependency on Rails 3 while trying to use Rails 2. What gems are you using? 在尝试使用Rails 2时,您似乎对Rails 3拥有宝石依赖。 You might have to dive into each one and get more specific in which version to use (to ensure that it works with Rails 2). 您可能必须深入研究每个版本,并更具体地使用哪个版本(以确保它与Rails 2兼容)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM