dingr
2009-05-02 18:56 阅读 242
已采纳

安装chito1.1.0 rake 出错问题 求解

安装chito1.1.0 rake 的时候出现如下错误

D:\chito>rake db:migrate
(in D:/chito)
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

(See full trace by running task with --trace)
[b]问题补充:[/b]
D:\chito>rake db:migrate --trace
(in D:/chito)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
14001: 由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个
问题。 - d:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-unknown/ext/RMagick.so
d:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-unknown/ext/RMagick.so
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in
require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:521:in new_constants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in
require'
d:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-unknown/lib/RMagick.rb:11
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_re
quire'
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:521:in
new_constants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in require'
D:/chito/vendor/plugins/simple_captcha/lib/simple_captcha_image.rb:4
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_re
quire'
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in
require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:521:in new_constants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in
require'
D:/chito/vendor/plugins/simple_captcha/init.rb:5:in evaluate_init_rb'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin.rb:103:in
evaluate_
init_rb'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/k
ernel/reporting.rb:11:in silence_warnings'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin.rb:99:in
evaluate_i
nit_rb'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin.rb:44:in load'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:33:in
loa
d_plugins'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:32:in eac
h'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/plugin/loader.rb:32:in
loa
d_plugins'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:323:in load_plugi
ns'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:160:in
process'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:323:in load_plugi
ns'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:160:in
process'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in send'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in
run'
D:/chito/config/environment.rb:17
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_re
quire'
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:521:in
new_constants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
es.rb:153:in require'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
call'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
each'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
invoke_with_call_c
hain'
d:/ruby/lib/ruby/1.8/monitor.rb:242:in synchronize'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_c
hain'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in invoke_prerequisit
es'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in
each'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in invoke_prerequisit
es'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in
invoke_with_call_c
hain'
d:/ruby/lib/ruby/1.8/monitor.rb:242:in synchronize'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_c
hain'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
invoke_task'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
each'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exceptio
n_handling'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in top_level'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in
run'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exceptio
n_handling'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in
run'
d:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
d:/ruby/bin/rake:19:in `load'
d:/ruby/bin/rake:19

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • 已采纳
    horace_lee horace_lee 2009-05-06 21:24

    我又仔细的看了一遍,并且我自己跑了一下,我的是可以用的
    你的问题看着像是Rmaick的问题,要是不行的话,建议你重新下载

    [url=http://rubyforge.org/frs/download.php/46136/RMagick-2.7.1-ImageMagick-6.4.5-3-Q8.zip]RMagick-2.7.1-ImageMagick-6.4.5-3-Q8.zip[/url]

    安装,我是用的这个,因为,我看你是windows下的

    解压缩,装一个exe,gem install一个gem,保证都不出错再运行

    [code="linux"]rake db:create [/code]

    [code="linux"]rake db:migrate[/code]

    * Ruby 1.8.6 +
    * Rails 2.0 +
    * RMagick
    * MySQL 数据库
    

    这是人家的要求,而且
    我的smtp总是不对所以,我把email.rb改了
    #ActionMailer::Base.delivery_method = CHITO_CONFIG[:mail][:method]
    #ActionMailer::Base.smtp_settings = CHITO_CONFIG[:mail][:settings]

    [code="ruby"] # config/environments/development.rb
    ActionMailer::Base.raise_delivery_errors = true

    set delivery method to :smtp, :sendmail or :test

    #config.action_mailer.
    ActionMailer::Base.delivery_method = :smtp

    these options are only needed if you choose smtp delivery

    #config.action_mailer.
    ActionMailer::Base.smtp_settings = {
    :address => 'smtp.gmail.com',
    :port => 587,
    :authentication => :plain,
    :user_name => 'user@gmail.com', #你的gmail帐号
    :password => 'password' #你的gmail密码
    }[/code]

    参考吧,希望有帮助

    点赞 评论 复制链接分享
  • horace_lee horace_lee 2009-05-04 08:12

    先运行
    [code="ruby"]
    rake db:migrate --trace
    [/code]
    贴出跟踪信息

    点赞 评论 复制链接分享
  • horace_lee horace_lee 2009-05-06 17:15

    [quote]You might have expected an instance of ActiveRecord::Base. [/quote]

    这是说少model吧,

    那你先确认一下,你运行migrate之前,是不是运行过
    [code="ruby"]rake db:create[/code]
    或者,已经有对应的数据库表了?

    点赞 评论 复制链接分享

相关推荐