[英]What is causing private method `gsub` called for nil:NilClass during Rails migration?
I've never sent this one before. 我从来没有寄过这个。 I'm configuring a new server with an existing application. 我正在使用现有应用程序配置新服务器。 Trying to run a migration and here's the output. 尝试运行迁移,这是输出。
root@beta:/vol/opt/dev/capistrano/foo-alpha/releases/20120330233010# RAILS_ENV=production rake db:migrate --trace
rake aborted!
private method `gsub' called for nil:NilClass
/usr/local/rvm/gems/jruby-1.6.6@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:77:in `require'
org/jruby/RubyArray.java:1614:in `each'
/usr/local/rvm/gems/jruby-1.6.6@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
/usr/local/rvm/gems/jruby-1.6.6@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
/vol/opt/dev/capistrano/foo-alpha/releases/20120330233010/config/application.rb:7:in `(root)'
org/jruby/RubyKernel.java:1027:in `require'
/usr/local/rvm/rubies/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/vol/opt/dev/capistrano/foo-alpha/releases/20120330233010/config/application.rb:4:in `(root)'
org/jruby/RubyKernel.java:1052:in `load'
/vol/opt/dev/capistrano/foo-alpha/releases/20120330233010/Rakefile:25:in `load_rakefile'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `load_rakefile'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `run'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/jruby-1.6.6@foo/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1052:in `load'
/usr/local/rvm/gems/jruby-1.6.6@foo/bin/rake:19:in `(root)'
Migrations on my local laptop and on an existing server are working fine. 我的本地笔记本电脑和现有服务器上的迁移工作正常。 config/database.yml looks right. config / database.yml看起来正确。 Database is up and running and I can connect to it. 数据库已启动并正在运行,我可以连接到它。 What is this? 这是什么?
I also just tested rails console
and I'm also not able to get a console. 我还测试了rails console
,但也无法获得控制台。 Again a private method gsub
called for nil:NilClass. 同样,私有方法gsub
调用了nil:NilClass。 It's somehow related to connecting to the database and I'm not sure how/why. 它与连接数据库有某种关系,我不确定如何/为什么。
** UPDATE ** **更新**
After adding some debug into runtime.rb, this is the exception that's being raised: 将一些调试添加到runtime.rb之后,这是引发的异常:
#<LoadError: no such file to load -- activerecord-jdbcmysql-adapter>
The messed up part is, it is installed: 混乱的部分是,它已安装:
# gem list |grep -i activerecord-jdbcmysql-adapter
activerecord-jdbcmysql-adapter (1.2.2)
Is this some kind of RVM or bundler bug? 这是某种RVM还是捆绑程序错误?
** LAST UPDATE ** ** 最后更新 **
I installed Amazon Linux AMI (The other is running an Ubuntu) and cannot replicate this issue there. 我安装了Amazon Linux AMI(另一个正在运行Ubuntu),并且无法在此复制此问题。
This is a bug in bundler, it was reported for rvm-capistrano, please check your Gemfile and try removing / commenting some gems. 这是捆绑程序中的错误,据报道是rvm-capistrano的错误,请检查您的Gemfile并尝试删除/注释一些宝石。
https://github.com/carlhuda/bundler/issues/1801 https://github.com/carlhuda/bundler/issues/1801
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.