0

I just installed facebook connect for my site, but without having edited something on the files that cast the error I get this:

rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex
/var/www/###/Rakefile:10:in `require'
(See full trace by running task with --trace)

In line 10 of my Rakefile you find:

require 'tasks/rails'

I haven't edited 'tasks/rails'... what is this Mutex and why does it now cast this error?

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
Joern Akkermann
  • 3,542
  • 8
  • 33
  • 41
  • possible duplicate of [uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)](http://stackoverflow.com/questions/5176782/uninitialized-constant-activesupportdependenciesmutex-nameerror) – Andrew Marshall Mar 14 '11 at 22:27
  • no, the answers in your post don't solve the problem... – Joern Akkermann Mar 14 '11 at 22:39
  • What is the output of `gem --version` and `rails --version` and `ruby --version`? – Andrew Marshall Mar 14 '11 at 22:46
  • RubyGems: 1.6.2, Rails: 3.0.5, Ruby: 1.8.7 (possible to switch to 1.9.2); The Rails project runs as 2.3.4 – Joern Akkermann Mar 15 '11 at 13:16
  • Wait, so you're trying to run a project for Rails 2.3.4 with the 3.0.5 gem? – Andrew Marshall Mar 15 '11 at 13:42
  • the project is configured to 2.3.4, I'm used to having rails recognized this and using the configured version; it always worked this way... very strange is the fact that it always worked, but suddenly no more... on my local machine I had no problems, then after git pushing and pulling to my server, the problem came up – Joern Akkermann Mar 15 '11 at 14:10

3 Answers3

1

the error is probably thrown because some code that is in the module ActiveSupport::Dependencies wants to use the Mutex class, but the class for some reason can not be autoloaded.

Sometimes the problem lies not in the code, but in the environment - like conflicting gems, i guess the issue is that your freshly installed facebook connect messes up some parts in your system

It can help to look at the rake some:task --trace output, to determine which file causes the problem - maybe look for calls to facebook connect library, and then try to play with that file - comment out lines that might be causing your problem, to determine what has to be done.

To help you further one would need the stack trace, the list of your gems and their version used in the project and maybe steps what have you done while installing the facebook connect

Valdis
  • 3,170
  • 2
  • 18
  • 24
1

If you can't upgrade from rails 2.3.4, require 'thread' in Rakefile, before boot.rb is initialized.

You may also need to require it in config/environment.rb, and script/server.

Looks like this:

require 'thread'
require File.join(File.dirname(__FILE__), 'boot')
Aaron
  • 2,241
  • 2
  • 13
  • 5
0

You have Rails 3.0.5 installed, but are trying to use 2.3.4. While, if you have 2.3.4 installed additionally, they shouldn't conflict to much, I'd recommend you take a look at using RVM for development to create isolated development environments (called gemsets).

Further, you're using Rails 2.3.4, which is incompatible with Rubygems 1.6. I highly recommend you upgrade rails to the latest 2.3 version (currently 2.3.11), as it includes numerous bug and security fixes, as well as compatibility with the latest Rubygems. Alternatively you can downgrade Rubygems to 1.3.7, but I'd advise upgrading Rails instead as it's a better long-term solution and includes numerous critical security fixes.

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214