我使用 JRuby 和 Rails 3.2,但现在我发现我必须在 Rails 2 上工作。
我知道一些关于 Rails 2 的基本知识,比如jruby ./script/server
启动服务器的命令,rails s
但是当我们开始谈论 Rails 2 中的 gems 时,事情对我来说变得复杂了。
现在我需要运行该项目,我得到了下一个错误:
首先是这个重复的消息:
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from C:/jruby-.6.7.2/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91.
还有这个:
config.gem: Unpacked gem activerecord-jdbc-adapter-0.9 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem activerecord-jdbcmysql-adapter-0.9 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem builder-2.1.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem ci_reporter-1.6.0 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem CVS in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem CVS in vendor/gems not in a versioned directory. Giving up.
config.gem: Unpacked gem jdbc-mysql-5.0.4 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem remarkable-3.1.8 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem remarkable_activerecord-3.1.8 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem remarkable_rails-3.1.6 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem ruby-ole-1.2.10.1 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem spreadsheet-0.6.4.1 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem will_paginate-2.2.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
最后在服务器即将启动时:
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
WARNING: Using default logging
RuntimeError: will_paginate 3.0 is not compatible with Rails 2.3 or older
(root) at C:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/will_paginate-3.0.4/lib/will_paginate.rb:8
require at org/jruby/RubyKernel.java:1033
require at C:/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60
require at C:/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55
require at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:156
new_constants_in at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:521
new_constants_in at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:520
require at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:156
(root) at C:/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/will_paginate-3.0.4/lib/will_paginate.rb:67
require at org/jruby/RubyKernel.java:1033
require at C:/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
require at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:156
new_constants_in at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:521
new_constants_in at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:520
require at D:/MyProject/vendor/rails/activesupport/lib/active_support/dependencies.rb:156
(root) at D:/MyProject/config/environment.rb:84
require at org/jruby/RubyKernel.java:1033
require at D:/MyProject/vendor/rails/railties/lib/commands/server.rb:36
(root) at ./script/server:3
我会提供任何其他细节来帮助解决这个问题,请告诉我。谢谢!