0

I work with JRuby and Rails 3.2 but now I've found I got to work on a project on Rails 2.

I know some basic things about Rails 2 like the command jruby ./script/server to start the server instead of rails s but when we start talking about gems in Rails 2 things get complicated for me.

Right now I need to run the project and I'm getting the next errors:

First this repetitive message:

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.

Also this:

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.

And finally right when the server it's about to start:

=> 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

I would provide any other details to help solving this just let me know. Thnaks!

M.Octavio
  • 1,780
  • 2
  • 25
  • 39
  • 1
    Did you install will_paginate for a rails 3 project before? Try to run `rake gems:install` to install will_paginate in version 2 – Mindbreaker May 22 '13 at 17:16
  • yes, I use will_paginate in rails 3, I mannually installed the will_paginate in v 2 but it didn't solve the issue, how ever I've learned about 'rake gems:install' wich it's very useful. Thanks – M.Octavio May 22 '13 at 17:39
  • As I first mentioned this is JRuby with Rails 2, it turns out that I have to use JRuby v 1.3.1 instead of the v1.7.3. I really don't know why but this solved the issue allowing my app to run. – M.Octavio May 22 '13 at 23:31

0 Answers0