Rails的4.0.0 - GOT [否隐式转换的零转换成String" [英] Rails 4.0.0 - Got "no implicit conversion of nil into String"

查看:128
本文介绍了Rails的4.0.0 - GOT [否隐式转换的零转换成String"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚安装了一个全新的Rails 4.0.0应用程序,我得到这个错误( https://开头要点。 github.com/hartator/6404820 )在 http://0.0.0.0:3000

 不隐式转换的零转换成String

ActiveRecord的(4.0.0)的lib / active_record / connection_adapters / sqlite3_adapter.rb:24:在'初始化'
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters / sqlite3_adapter.rb:24:在'新'
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters / sqlite3_adapter.rb:24:在'sqlite3_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:440:在'new_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:450:在'checkout_new_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:421:在'acquire_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:356:在'挡在结账
/Users/asa/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in`mon_synchronize
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:355:在'结账'
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:265:在'块连接
/Users/asa/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in`mon_synchronize
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:264:在'连接'
ActiveRecord的(4.0.0)的lib / active_record / connection_adapters /抽象/ connection_pool.rb:546:在'retrieve_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_handling.rb:79:在'retrieve_connection
ActiveRecord的(4.0.0)的lib / active_record / connection_handling.rb:53:在'连接'
 

我的database.yml: http://pastebin.com/JM5TNmNU

我还没有到香草轨code做任何事情。任何想法可能是什么问题?

使用:

  • 的Rails 4.0.0
  • 红宝石2.0.0p195
  • 在山狮10.8.2
解决方案

这听起来像你sqlite3的宝石安装问题。尝试:

 宝石质朴的sqlite3
 

从RubyGems的文档:

  

宝石质朴

     

还原安装宝石原始状态从位于宝石缓存文件

     用法

 创业板原始[GEMNAME ...] [选项]
 

<一个href="http://guides.rubygems.org/command-reference/#gem_pristine">http://guides.rubygems.org/command-reference/#gem_pristine

Just installed a brand new Rails 4.0.0 app and I got this error (https://gist.github.com/hartator/6404820) on http://0.0.0.0:3000:

no implicit conversion of nil into String

activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `initialize'
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `new'
activerecord (4.0.0) lib/active_record/connection_adapters/sqlite3_adapter.rb:24:in `sqlite3_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/Users/asa/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/Users/asa/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
activerecord (4.0.0) lib/active_record/connection_handling.rb:79:in `retrieve_connection'
activerecord (4.0.0) lib/active_record/connection_handling.rb:53:in `connection'

My database.yml: http://pastebin.com/JM5TNmNU

I haven't done anything yet to the vanilla rails code. Any idea what could be the issue?

Using:

  • Rails 4.0.0
  • Ruby 2.0.0p195
  • Mountain Lion 10.8.2

解决方案

That sounds like a problem with your sqlite3 gem installation. Try:

gem pristine sqlite3

From the RubyGems documentation:

gem pristine

Restores installed gems to pristine condition from files located in the gem cache

Usage

gem pristine [GEMNAME ...] [options]

http://guides.rubygems.org/command-reference/#gem_pristine

这篇关于Rails的4.0.0 - GOT [否隐式转换的零转换成String&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆