Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) - How to resolve? [duplicate]

半腔热情 提交于 2019-11-28 08:28:17

问题


Possible Duplicate:
Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)

Hey I have seen this issue a lot across the web... Anybody resolve this with any success?

My app is RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION

The log output

/Users/tjs/.rvm/gems/ruby-1.8.7-p352@rails2/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
from /Users/tjs/.rvm/gems/ruby-1.8.7-p352@rails2/gems/activesupport-2.3.5/lib/active_support.rb:56
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
from /Users/tjs/.rvm/gems/ruby-1.8.7-p352@rails2/gems/rails-2.3.5/lib/commands/server.rb:1
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /Users/tjs/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
from script/server:4

I have tried requiring thread in the environment.rb, script/sever and rakefile but that just blows up the log...

I have rvm using 1.8.7 which I think is compatible. But I am still newer to rvm so not totally sure I have it working right.

I have 3 apps running rails 2.x and have this problem with all of them.


回答1:


http://ecmanaut.blogspot.com/2011/09/running-old-rails-238-with-rvm.html followed these steps and the app works again.

thanks for all the posts




回答2:


add the "require 'thread'"statement to your "boot.rb" file.

require 'thread'
require File.join(File.dirname(__FILE__), 'boot')



回答3:


you just need use a new gemset using rbenv https://github.com/jamis/rbenv-gemset or rvm and install this one rubygems-update 1.4.2

gem install -v 1.4.2 rubygems-update
gem update --system 1.4.2

cheers




回答4:


Another solution that worked for me is to use rails of higher minor version by settting env:

export RAILS_GEM_VERSION=2.3.12


来源:https://stackoverflow.com/questions/7862845/uninitialized-constant-activesupportdependenciesmutex-nameerror-how-to-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!