0

when I start my rails server using ruby script/server command, I am getting the following response

=> Booting WEBrick
=> Rails 2.3.9 application starting on http://0.0.0.0:3000
/home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError)
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/initializer.rb:298:in `add_gem_load_paths'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/initializer.rb:132:in `process'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/initializer.rb:113:in `send'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/initializer.rb:113:in `run'
        from /home/ubuntu/apps/moogle/config/environment.rb:13
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:182:in `require'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:182:in `require'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:182:in `require'
        from /home/ubuntu/.rvm/gems/ruby-1.8.7-p374@gemset1/gems/rails-2.3.9/lib/commands/server.rb:84
        from script/server:3:in `require'
        from script/server:3

I am using ProxyPreseve like

<VirtualHost *:80>
 ProxyPreserveHost On
    ProxyPass / http://0.0.0.0:3000/
    ProxyPassReverse / http://0.0.0.0:3000/
    ServerName localhost
</VirtualHost>

And I am getting 503 Service Unavailable Error. Can anyone tell me whats wrong in my application?

Rails version: 2.3.9 Ruby version: 1.8.7-p374 Bundle version: 1.12.5 Gem version: 2.0.17

Karthik Malla
  • 5,570
  • 12
  • 46
  • 89
  • Just to confirm: Are you really trying to run Rails `2.3.9` on Ruby `1.8.7`? – spickermann Sep 07 '16 at 09:08
  • @spickermann - Yes, that's right. – Karthik Malla Sep 07 '16 at 09:11
  • something wrong with `rubygems` version http://stackoverflow.com/questions/15349869/undefined-method-source-index-for-gemmodule-nomethoderror – Deepak Mahakale Sep 07 '16 at 09:14
  • Both version are outdated and unmaintained for more than 3 years. Rails 2.3 has known security issues that will not be fixed anymore. Furthermore current gems will not run with Ruby 1.8.7 anymore. I suggest to start updating your application to current versions of Rails and Ruby with a high priority. – spickermann Sep 07 '16 at 09:21
  • @spickermann - I know but I need to first run the application so that I can upgrade it. I can't directly run the application with latest version or Ruby. I first have to get it running in 1.8.7 and then I can try to upgrade. – Karthik Malla Sep 07 '16 at 09:26

1 Answers1

1

You need to downgrade the rubygems version

gem update --system 1.8.25

refer solution to the same problem here

Community
  • 1
  • 1
Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88