Ruby 1.8.x Rails 2.x 的 "uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)" 錯誤

坑爹的異常。

在 Ruby 安裝目錄下的 bin 目錄下找到 rails 文件:比如:C:\Ruby187\bin
修改 rails,在 require 'rubygems' 之後加上 require 'thread'

  1. #!C:/Ruby187/bin/ruby.exe  
  2. #  
  3. # This file was generated by RubyGems.  
  4. #  
  5. # The application 'rails' is installed as part of a gem, and  
  6. # this file is here to facilitate running it.  
  7. #  
  8. require 'thread'  
  9. require 'rubygems'  
  10.   
  11. version = ">= 0"  
  12.   
  13. if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then  
  14.   version = $1  
  15.   ARGV.shift  
  16. end  
  17.   
  18. gem 'rails', version  
  19. load Gem.bin_path('rails''rails', version)  

接下來運行 rails SomeApp 生成 Rails 應用之後,再啓動rake:ruby Script/Sever 還會出上面的錯誤,則需要在
Ruby 安裝目錄下,查找 environment.rb,boot.rb 文件,同樣在前面加上 require 'thread'
上一篇:WCF實例 —— Windows Service Host 開發,調試,製作安裝包 下一篇:WCF WebSocketsService (HTML5 WebSocket)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章