红矿+ gem_dependency.rb:119:警告:Gem::Dependency#version_requirements 已弃用,并将于 2010 年 8 月或之后删除

发布于 2024-11-03 04:50:33 字数 1178 浏览 2 评论 0原文

/redmine$ ruby​​ 脚本/服务器 -e 制作 =>启动 WEBrick => Rails 2.3.5 应用程序从 http://0.0.0.0:3000 开始 /home/siya/.rvm/gems/ruby-1.8.7-p330/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:警告:Gem::Dependency#version_requirements 已弃用并将被删除2010 年 8 月或之后。使用 #requirement /home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in real_connect': 无法连接到本地 MySQL 服务器通过套接字 '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error) 来自 /home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:inconnect'

出现此问题的时间我重新启动我的应用程序。事实上昨天它运行得很好。但今天我尝试了很多并在网上搜索,但未能成功。

谷歌搜索后,我得到了一个更新系统的命令,即 sudo gem update --system

现在出现了新的错误:

/home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
    from /home/siya/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'

/redmine$ ruby script/server -e production
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/home/siya/.rvm/gems/ruby-1.8.7-p330/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
/home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in real_connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)
from /home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in
connect'

This issue occur's when I restart my application. In fact yesterday it was running fine. But today I tried a lot and searched the web, but could not get success.

After googling, I got one command to update the system ie sudo gem update --system

Now new error occurs:

/home/siya/.rvm/gems/ruby-1.8.7-p330/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
    from /home/siya/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人事已非 2024-11-10 04:50:33

将 Rails 升级到最新版本(2.3.5 相当旧)。

gem install rails --version 2.3.11

您还需要更新environment.rb中的依赖项,将RAILS_GEM_VERSION设置为2.3.11

Run rake rails:update

测试! Rails 升级似乎很少是无缝的。您确实有一套广泛的单元测试,不是吗...:)

Upgrade rails to the latest version (2.3.5 is fairly old).

gem install rails --version 2.3.11

You will also need to update your dependencies in your environment.rb, to set RAILS_GEM_VERSION to 2.3.11

Run rake rails:update

Test! Rails upgrades seem to rarely be seamless. You do have an extensive suite of unit tests, don't you... :)

悟红尘 2024-11-10 04:50:33

有时,在解决此类问题时。我们再次提出任何其他冲突。

所以最好的部分是,只需采取
应用程序文件夹的 bakcup 和
公共文件夹。整个重新安装
Rails 和 ruby​​。

因为花了一整天的时间来解决这个问题。我遵循了这个程序。请不要浪费时间。

Some-time, In resolving such type of issues. We again raise any other conflict.

So best part is that,just take the
bakcup of application folder and
public folder. Re-install the whole
rails and ruby.

Because after investing whole day to resolve this issue. I followed this procedure. Please do not waste time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文