【问题标题】:Connecting firebird database with rails 3将 firebird 数据库与 rails 3 连接
【发布时间】:2012-06-26 14:33:37
【问题描述】:

我想将我的 rails 3 应用程序连接到 firebird 数据库。我关注了

https://help.ubuntu.com/community/Firebird2.5

http://mapopa.blogspot.in/2009/02/rails-on-firebird-status-after-adapter.html

链接。此外,我已将 gem 'activerecord-fb-adapter' 和 gem 'fb' 包含到 gemfile 中。

但是,我收到了响应“没有建立 Firebird 连接。”

同时运行 rake db:create 结果

 {:adapter=>"fb",
  :database=>"localhost/3050:/var/lib/firebird/2.5/data/rubyonfire.fdb",
  :username=>"SYSDBA",
  :password=>"*******",
  :host=>"localhost",
  :downcase_names=>true}

 {:adapter=>"fb",
  :database=>"localhost/3050:/var/lib/firebird/2.5/data/rubyonfire_test.fdb",
  :username=>"SYSDBA",
  :password=>"*******",
  :host=>"localhost",
  :downcase_names=>true}

非常感谢任何帮助。

提前致谢。

【问题讨论】:

  • 你能从linux命令行连接到它吗?
  • @Guillem - 是的,非常顺利。
  • 我可能是错的,但是你为什么把“localhost/3050:”放在数据库目录前面?您已经告诉他数据库位于 Host 属性中的 localhost 中。尝试将数据库设置为“/var/lib/firebird/2.5/data/rubyonfire.fdb”
  • @Guillem - 我不是这么说的,这是运行 rake db:create 命令后的结果。
  • 顺便说一句,我得到了解决方案并将其发布在这里。

标签: ruby-on-rails-3 firebird firebird2.5


【解决方案1】:

在 database.yml 中添加 create: true 解决了这个问题。详情见以下链接:-

https://github.com/rowland/activerecord-fb-adapter/issues/1#issuecomment-6608210

谢谢

【讨论】:

  • 我建议接受答案,以便其他人可以看到答案对您有所帮助。阅读 stackoverflow.com/faq 了解有关 Stackoverflow 的更多信息。
猜你喜欢
  • 1970-01-01
  • 2018-02-13
  • 1970-01-01
  • 1970-01-01
  • 2017-04-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-30
相关资源
最近更新 更多