生产盒上的 Sqlite
我是否必须在使用 mysql 作为 Rails 应用程序的产品盒上安装 sqlite?我问的原因是 phusion 向我大喊以下错误:
Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources. (Bundler::GemNotFound)
我的 gemfile 有以下内容
group :development, :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
end
group :production do
gem 'mysql'
end
如果我注释掉开发部分下的条目,我的问题就会消失。我猜我也可以在产品服务器上安装 sqlite,但由于某种原因,这对我来说似乎是错误的。我假设在 :development 部分中引用可以防止这种情况发生,但显然情况并非如此。
对于这种情况,有什么最佳实践建议吗?如果您发现我做错了什么,我会特别感兴趣。
Should I have to install sqlite on a prod box where I'm using mysql for a rails application? The reason I ask is that phusion is yelling at me with the following error:
Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources. (Bundler::GemNotFound)
My gemfile has the following
group :development, :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
end
group :production do
gem 'mysql'
end
If I comment out the entry under the development section my problem goes away. I'm guessing I could also install sqlite on the prod server but for some reason that seems wrong to me. I was assuming that having the reference in the :development section would prevent this from happening, but that obviously does not appear to be the case.
Any suggestions of best practice for this scenario? I'd be especially interested if you see that I am doing something wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您运行
bundler install
时,默认情况下,bundler 将尝试解析并安装所有环境的 Gems。如果想跳过特定环境,可以传递
--without
参数。另外,请记住使用
--deployment
标志。When you run
bundler install
, by default bundler will try to resolve and install the Gems for all the environments.If you want to skip a specific environment, you can pass the
--without
parameter.Also, remember to use the
--deployment
flag.