生产盒上的 Sqlite

发布于 2024-09-27 07:54:58 字数 545 浏览 8 评论 0原文

我是否必须在使用 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 技术交流群。

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

发布评论

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

评论(1

若沐 2024-10-04 07:54:58

当您运行 bundler install 时,默认情况下,bundler 将尝试解析并安装所有环境的 Gems。

如果想跳过特定环境,可以传递--without参数。

$ bundler install --without development
$ bundler install --without test development

另外,请记住使用 --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.

$ bundler install --without development
$ bundler install --without test development

Also, remember to use the --deployment flag.

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