0

When I try to start up the MacPorts installed Ruby on Rail Webrick Server to get back into my RoR training after putting it down for like a year I got the following errors on executing ruby -d script/server:

Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:1215 - no such file to load -- rubygems/defaults/operating_system
Exception `NoMethodError' at /opt/local/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `Gem::LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247 - Could not find memcache-client (>= 1.7.4) amongst [abstract-1.0.0, actionmailer-3.0.3, actionmailer-2.3.8, actionpack-3.0.3, actionpack-2.3.8, activemodel-3.0.3, activerecord-3.0.3, activerecord-2.3.8, activeresource-3.0.3, activeresource-2.3.8, activesupport-3.0.3, activesupport-2.3.8, arel-2.0.6, builder-2.1.2, bundler-1.0.7, cgi_multipart_eof_fix-2.5.0, daemon_controller-0.2.6, daemons-1.1.0, erubis-2.6.6, fastthread-1.0.7, gem_plugin-0.2.3, i18n-0.5.0, mail-2.2.12, mime-types-1.16, mongrel-1.1.5, mysql-2.8.1, mysql2-0.2.10, passenger-3.0.7, polyglot-0.3.1, rack-1.2.1, rack-1.1.0, rack-mount-0.6.13, rack-test-0.5.6, rails-3.0.3, rails-2.3.8, railties-3.0.3, rake-0.8.7, rubygems-update-1.8.5, sqlite3-ruby-1.3.2, thor-0.14.6, treetop-1.4.9, typhoeus-0.3.3, tzinfo-0.3.23, xml-simple-1.1.1]
        /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/vendor.rb:32: warning: redefine normalize_translation_keys
Exception `TypeError' at (eval):4 - can't modify frozen object
Exception `MissingSourceFile' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- fast_xs
Exception `MissingSourceFile' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:62 - no such file to load -- fast_xs
Exception `NameError' at /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55 - uninitialized constant ActiveSupport::Dependencies::Mutex
        /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support.rb:57
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'

Are these errors caused because the Rails project I made before was made with an older Gems or Ruby version (Been updated every time I updated my MacPorts)? How can I remedy this?

Update

Found Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) which is similar. Now updating gems and retrying all again soon.

Update 2

Updated all gems Just got one error:

Updating mysql2
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find a valid gem 'mysql2' (0.3.11) locally or in a repository

Error:

ruby script/server
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support.rb:57
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:1
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from script/server:3

still persists, but may need some kind of restart

Update 3

I added require 'thread' to to the top of config/boot.rb as suggested in the answer of @thekingoftruth at the earlier mentioned thread. Now Webrick starts. I do get a lot of errors still saying:

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:320.
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 /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127.
Community
  • 1
  • 1
rhand
  • 1,176
  • 4
  • 17
  • 45
  • 1
    I would suggest installing rvm (Ruby Version Manager - https://rvm.io/rvm/basics/) or rbenv (Simple Ruby Version Management - https://github.com/sstephenson/rbenv) to manage your ruby installs and not use Macports - then create a new rails 3+ application for your training exercises – house9 May 12 '12 at 17:10
  • Will look into RVM. Thanks @house9 It is just that I use MacPorts for many of the *Nix programs that I need and I love the way I can keep them updated on my Mac without using a VM. But perhaps running RVM is more convenient for RoR. – rhand May 13 '12 at 01:26

1 Answers1

0

As shown in updates I resolved the issue myself. And I am using RVM now on my OSX Lion.

rhand
  • 1,176
  • 4
  • 17
  • 45