0

I am running a linux instance. My question is the same as LoadError running Mongrel with Rails3 and Ruby 1.9.2 except for the fact that I am running Ruby 1.8.7 and I am using Linux.

Here is the contents of the mongrel_cluster.log:

** Starting Rails with development environment...
/usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require': no such file to load -- dispatcher (LoadError)
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:148:in `rails'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
        from /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
        from /usr/bin/mongrel_rails:19:in `load'
        from /usr/bin/mongrel_rails:19

I am at a loss on how to fix this.

Can someone help please? TIA

Community
  • 1
  • 1
VJ Vélan Solutions
  • 6,434
  • 5
  • 49
  • 63

1 Answers1

0

What does gem listreturns?

How does your Gemfile looks like?

Did you try reinstalling Rails?

Consider using RVM and a Gemset for each project so that you can isolate gem conflicts.

http://nerian.github.com/2011/01/15/RPS-1-RVM.html

Nerian
  • 15,901
  • 13
  • 66
  • 96
  • @Nerian, gem list is too long to paste here. but it includes rails (3.0.8), mongrel (1.1.5), rubygems-update (1.8.5), rvm (1.6.20). I just had "gem 'rails', '3.0.8' and gem 'pg' lines in Gemfile. I tried adding gem 'mongrel' to Gemfile and did "bundle update" -- did not help. No, i have not tried reinstalling Rails. How do i do that? Using "gem" command? Thanks. – VJ Vélan Solutions Jun 11 '11 at 13:10
  • @Nerian, i did "gem uninstall rails" and "gem install rails" - effectively reinstalling rails. that did not help as well. i continue to see the same error log. thanks. – VJ Vélan Solutions Jun 11 '11 at 13:18
  • @user: You are using RVM? Then why does the error says `/usr/lib64/ruby/gems/1.8/`. If you are using RVM then it should output an folder inside ~/.rvm. Are you sure you are using the ruby installed by RVM? What does `which ruby` returns? – Nerian Jun 11 '11 at 15:13
  • @user: You are not using RVM then, Do you have something like this [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" in your .bash_profile ? – Nerian Jun 11 '11 at 23:36
  • @Nerian, No, I do have that line in my .bash_profile. export LD_LIBRARY_PATH [[ -s "/home/ec2-user/.rvm/scripts/rvm" ]] && source "/home/ec2-user/.rvm/scripts/rvm" # This loads RVM into a shell session. Let me try to follow your instructions in the blog you have pasted earlier and see if that helps. Thanks. – VJ Vélan Solutions Jun 12 '11 at 01:25
  • @user: don't forget to do: Rvm use 1.9.2 --default – Nerian Jun 12 '11 at 01:31
  • In your blog, you have this command: $ "rvm --create use '1.9.2@Hidra'" > .rvmrc . If i execute that, i see "-bash: rvm --create use '1.9.2@Hidra': command not found". So, do we really have to have the double quotes around rvm --create? I did rvm --help and i did not see --create as a valid option. Kindly clarify. – VJ Vélan Solutions Jun 12 '11 at 01:43
  • After creating and using the getset as mentioned in your blog, and setting "rvm use 1.9.2 --default", i now see "~/.rvm/rubies/ruby-1.9.2-p180/bin/ruby" for "$ which ruby". And when i run "$ mongrel_rails cluster::start", i see -- /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find mongrel (>= 0) amongst [] (Gem::LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec' from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1182:in `gem' from /usr/bin/mongrel_rails:18 I think i am worse off than what i began with. HELP!!! – VJ Vélan Solutions Jun 12 '11 at 02:39
  • It appears that i have to do "sudo mongrel_rails cluster::start" after using RVM. But the problem still continues. I still see the same error log as before. I would expect the ~/.rvm/ will be used for ruby but it does not appear so. I see that the system is still using the one located at /usr/lib. It appears as if the ~/project/.rvmrc does not have any effect even though "which ruby" and "which gem" shows the ~/.rvm/... path. Confused, as usual. I am not very familiar with ruby and gems and mongrel and stuff :( – VJ Vélan Solutions Jun 12 '11 at 03:41
  • @Nerian, I was finally able to make sure that i am using ruby 1.9.2 via rvm and this time, the error is still the same but the path of ruby in the error is as expected by you originally - ** Starting Mongrel listening at 127.0.0.1:8000 ** Starting Rails with production environment... ** Mounting Rails at /home/ec2-user/test_ruby_1.9.2... /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.8/lib/active_sup port/dependencies.rb:239:in `require': no such file to load -- dispatcher (LoadError) Any help from this point onwards? – VJ Vélan Solutions Jun 12 '11 at 13:47
  • @user: When you use RVM you don't use the system's ruby and its gems. So when you changed to RVM your gem list was empty. You need to use `bundle install` inside your rails app so that it install the gems listed in your Gemfile. Check that you have 'gem mongrel' in your Gemfile. – Nerian Jun 12 '11 at 14:52
  • @user: Also, I think you are not very experienced with deployments, ruby or rails. I recommend that you use Heroku instead of amazon s3. Heroku has a very straightforward and automated deployment process. That would help you to focus just in learning rails and ruby. – Nerian Jun 12 '11 at 14:56
  • @Nerian, Thanks. After switching over to RVM and using 1.9.2, i did a complete "gem install " of all the required gems like mongrel, etc. And i had also updated my Gemfile and did "bundle update" and "bundle install". The problem is the various intricacies with mongrel and rails dependencies - the compatilibities are not very straight forward. I see a lot of ppl are facing these issues. I will try heroku as per your suggestion. Thanks. – VJ Vélan Solutions Jun 12 '11 at 15:32