gpt4 book ai didi

ruby-on-rails - 未初始化的常量 ActiveSupport::Dependencies::Mutex

转载 作者:数据小太阳 更新时间:2023-10-29 07:01:09 26 4
gpt4 key购买 nike

我尝试运行一个从 OSX 到 Debian 的工作 Rails 项目。我在两个系统上都使用 RVM 并为项目创建了相同的 gemsets 和 rvmrc。在 Debian 上,我只安装了带有 rvm 的 ruby​​,不存在 ruby​​ 的系统安装。

当我进入项目文件夹时,rvm 正在切换到版本 1.8.7 并正在使用项目 gemset,一切看起来都很好。

但是当我启动 rake -T 时,我得到了这个错误:

$ rake -T --trace
(in /home/i/project/src)
rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/activesupport-2.3.5/lib/active_support.rb:56
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rails-2.3.5/lib/tasks/misc.rake:18
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rails-2.3.5/lib/tasks/rails.rb:4
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `each'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rails-2.3.5/lib/tasks/rails.rb:4
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/ws/project/src/Rakefile:10
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/ home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/gems/rake-0.8.7/bin/rake:31
/home/i/.rvm/gems/ruby-1.8.7-p249@project/bin/rake:19:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249@project/bin/rake:19

最佳答案

对我来说,添加 require 'thread' 也不起作用。通过将 rubygems 降级到 1.4.2 解决了这个问题:

这是新版本的 rubygems(在我的例子中是 1.8.5)和旧版本的 rails(在我的例子中是 2.3.5)之间的兼容性问题

$ gem install rubygems-update -v='1.4.2'

$ gem uninstall rubygems-update -v='1.8.5'

$ update_rubygems

关于ruby-on-rails - 未初始化的常量 ActiveSupport::Dependencies::Mutex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5564251/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com