- 浏览: 17673 次
- 性别:
- 来自: 北京
最近访客 更多访客>>
最新评论
-
dazuiba:
rails-1.2.4update to 1.2.5updat ...
诡异的"already initialized constant OPTIONS"及解决方案
最近要为公司一个程序加数据统计代码。在Ubuntu环境下checkout下整个程序,发现无法打开server,出错信息如下:
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
ActiveScaffold: extending RESTful routes for students
ActiveScaffold: extending RESTful routes for student_profiles
ActiveScaffold: extending RESTful routes for discount_codes
ActiveScaffold: extending RESTful routes for trainers
ActiveScaffold: extending RESTful routes for trainer_profiles
ActiveScaffold: extending RESTful routes for certified_modules
ActiveScaffold: extending RESTful routes for scenarios
Exiting
/var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:15: warning: already
initialized constant OPTIONS
/var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:18: undefined method
`options' for []:Array (NoMethodError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `require'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:495:in `require'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:495:in `require'
from /var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/server.rb:39
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
开始以为是环境出错,但发现新建的空项目可以运行。
于是搜索:"warning: already initialized constant OPTIONS"
得到
http://blog.1sters.com/?action=show&id=32
和
http://www.dansketcher.com/2007/05/07/warning-already-initialized-constant-options/
解决方法都说是缺少app中使用的gem,但查看environment.rb,安装所有require,server依然启动不起来。
搜索:"undefined method `options' for []:Array (NoMethodError)"
得到:
http://bpdp.wordpress.com/2007/08/27/what-does-mongrelrb15-warning-already-initialized-constant
-options-means/
作者的解决方案如下:
"All I have to do is remove all of the plugins (I just move it to directory
$RAILS_ROOT/tmp/plugins which I created myself) and then start move it one by one to
$RAILS_ROOT/vendor/plugins and test it using $RAILS_ROOT/script/server webrick.Then I found that
activemerchant is my problem. I need builder gem.It is all easy but the error messages was
really a mess"
按照他的方法,我把$RAILS_ROOT/vendor/plugins中的所有文件剪切出来再逐一拷贝回去并测试服务器,最终
发现是tzinfo_timezone导致的出错。
安装tzinfo_timezone,启动server,问题解决。
简单的问题,不过真是“ error messages was really a mess”
顺便说下,
http://blog.1sters.com/?action=show&id=32中说在environment.rb添加“require ‘nonexistingfile’”
可启动服务器,实际上这是复现这个错误的方法。
找可以运行的环境,查看安装的gem list,把缺少的安装一遍就行。上面好笨~~~
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
ActiveScaffold: extending RESTful routes for students
ActiveScaffold: extending RESTful routes for student_profiles
ActiveScaffold: extending RESTful routes for discount_codes
ActiveScaffold: extending RESTful routes for trainers
ActiveScaffold: extending RESTful routes for trainer_profiles
ActiveScaffold: extending RESTful routes for certified_modules
ActiveScaffold: extending RESTful routes for scenarios
Exiting
/var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:15: warning: already
initialized constant OPTIONS
/var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:18: undefined method
`options' for []:Array (NoMethodError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `require'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:495:in `require'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:495:in `require'
from /var/lib/gems/1.8/gems/rails-1.2.4/lib/commands/server.rb:39
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
开始以为是环境出错,但发现新建的空项目可以运行。
于是搜索:"warning: already initialized constant OPTIONS"
得到
http://blog.1sters.com/?action=show&id=32
和
http://www.dansketcher.com/2007/05/07/warning-already-initialized-constant-options/
解决方法都说是缺少app中使用的gem,但查看environment.rb,安装所有require,server依然启动不起来。
搜索:"undefined method `options' for []:Array (NoMethodError)"
得到:
http://bpdp.wordpress.com/2007/08/27/what-does-mongrelrb15-warning-already-initialized-constant
-options-means/
作者的解决方案如下:
"All I have to do is remove all of the plugins (I just move it to directory
$RAILS_ROOT/tmp/plugins which I created myself) and then start move it one by one to
$RAILS_ROOT/vendor/plugins and test it using $RAILS_ROOT/script/server webrick.Then I found that
activemerchant is my problem. I need builder gem.It is all easy but the error messages was
really a mess"
按照他的方法,我把$RAILS_ROOT/vendor/plugins中的所有文件剪切出来再逐一拷贝回去并测试服务器,最终
发现是tzinfo_timezone导致的出错。
安装tzinfo_timezone,启动server,问题解决。
简单的问题,不过真是“ error messages was really a mess”
顺便说下,
http://blog.1sters.com/?action=show&id=32中说在environment.rb添加“require ‘nonexistingfile’”
可启动服务器,实际上这是复现这个错误的方法。
找可以运行的环境,查看安装的gem list,把缺少的安装一遍就行。上面好笨~~~
发表评论
-
useful cheat sheets.
2009-11-11 14:40 846no need download cheat anymore: ... -
refactor according "rails best practices"
2009-11-09 17:53 885used "rails best practices ... -
code refactor(keep adding)
2009-11-05 10:20 8871.old code def page_group_to ... -
define_method with parameters
2009-11-03 18:07 761refactor below code: def ... -
example how to use 'stub' and 'mock' in sepc
2009-10-16 11:58 915Use sometime to learn stub and ... -
spec tips(keep adding)
2009-10-13 17:20 8911.stub meet "one to many&q ... -
do not rewrite exists methods
2009-09-20 23:30 776In order to name method like a ... -
never use not + not.
2009-09-19 22:57 831A bug take a long time to find ... -
use screen
2009-09-19 02:28 913Doing long time rake, screen is ... -
ruby trickes(keep adding)
2009-09-08 12:28 797some ruby tricke: 1.sho ... -
how to test gem
2009-08-31 14:09 800I wrote some gems in my project ... -
things learned from data migration
2009-08-20 13:57 838Spend a week for data migration ... -
我的emacs配置
2009-08-03 15:45 1971学习ruby on rails 两年了,期间使用过Eclips ...
相关推荐
Win10从Office2007安装MODI组件后用C#调用Interop.MODI.dll仍然报错“Object hasn't been initialized and can't be used yet”,调用Office2007的OCR组件Microsoft office document imaging也是失败的解决方案。
Java 异常解决方案 Java 异常是 Java 开发中经常遇到的问题,本文档将提供 Java 异常解决方案,涵盖 Hibernate、Tomcat、Java 基本、JSP、SSH 整合等多个方面的异常解决方案。 一、Hibernate 异常解决方案 * org....
### C++常见错误及解决方案 #### 一、在源码中遗失“;” **错误信息**: `syntax error: missing ‘;’` **错误示例**: ```cpp int test, number, test = 12; ``` **解决方案**: 在编程时,忘记在语句末尾加上...
# 错误:(eval):1: uninitialized constant C1 ``` 但是,如果我们通过类名来引用这些常量,就可以正确访问: ```ruby ruby> ConstClass::C1 # 输出:101 ``` 同样,我们可以通过类实例来调用`show`方法,展示类...
hudson插件加载失败解决方案 本文档将讨论hudson插件加载失败的解决方案,涵盖hudson版本、环境信息、插件安装、Tomcat日志分析、问题排查等方面的知识点。 一、hudson版本信息 hudson版本:hudson-2.2.1.war ...
(DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, ...),我找到了合适的libmysql.dll和dbxmys.dll组合,把下面这个libmysql.dll拷贝到XE的bin目录...
完美修复光盘刻录大师报crt not initialized的错误 使用方法:将文件覆盖到安装目录即可 解压密码:17
以下是一些解决“Could not initialize oci.dll”问题的步骤: 1. **下载Oracle Instant Client**: 首先,你需要从Oracle官方网站下载适合你的操作系统的Oracle Instant Client版本。在这个案例中,我们看到的...
液晶屏幕LCD SPI初始化是嵌入式系统中常见的一项任务,特别是在Windows CE(WinCE)操作系统中,用于驱动显示设备。SPI(Serial Peripheral Interface)是一种串行通信协议,它允许单主机与一个或多个设备进行全双工...
select-mania是一款基于jQuery的下拉框美化插件,这款插件可以很好地解决浏览器原生下拉框的丑陋以及不同浏览器的样式不同的问题。select-mania不仅可以在初始化的时候指定下拉框的尺寸,而且还可以指定下拉项的背景...
### 框架集合错误解决方案 #### 包含包冲突等常见问题 在软件开发过程中,尤其是使用多种框架和技术栈时,经常会遇到各种各样的错误和异常。本文将基于提供的内容,详细介绍几个常见的错误及其解决方案。 ### 1. ...
- **解决方案**: 检查数据是否重复,并确保每个字段值都是唯一的。 #### ORA-00017: Resource busy and acquire with NOWAIT specified - **解释**: 当尝试获取一个资源(如锁)时,如果该资源被其他进程占用,...
主要介绍了Spring使用redis遇到的问题及解决方案,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
**解决方案**: - 确保在项目设置中正确配置了预编译头文件。 - 在源代码文件顶部明确包含预编译头文件,例如`#include "stdafx.h"`。 #### 2. fatal error C1083: Cannot open include file: 'R.h': No such file ...
### Hibernate自动导入SQL文件import.sql国际化编码问题的解决方案 #### 背景介绍 在使用Hibernate框架时,经常需要在项目启动初期或者数据库更新时自动执行一些SQL脚本(如DDL脚本)来创建或更新数据库结构。这些...
### 最常见的20种VC++编译错误信息详解 在使用Visual C++(VC++)进行编程时,遇到编译错误是在所难免...通过以上详细的错误分析和解决方案,可以帮助开发者快速定位问题所在,并采取相应措施解决问题,提高开发效率。
### ICCAVR 编译器中 putchar() 未定义问题详解及解决方案 #### 一、问题背景 在使用 ICCAVR 编译器进行 AVR 单片机编程时,经常遇到 `_putchar` 符号未定义的问题。该问题通常出现在尝试在程序中使用 `putchar()`...
Sass Loader has been initialized using an options object that does not match the API schem a. – options has an unknown property ‘data’. These properties are valid: object {
- **解决方案**:确保项目设置中指定了预编译头文件,并且在源文件的顶部包含了预编译头文件。 #### 2. fatal error C1083: Cannot open include file: 'R.h': No such file or directory (无法打开包含文件 'R.h':...
- **解决方案**: - 检查源文件中是否缺少`#include "stdafx.h"`。 - 如果项目中启用了预编译头文件功能,则确保所有需要使用预编译头文件的源文件都包含了这条指令。 #### 2. fatal error C1083: Cannot open ...