Ruby 在本地运行Sinatra应用程序时,如何设置生产/开发环境

Ruby 在本地运行Sinatra应用程序时,如何设置生产/开发环境,ruby,rubygems,sinatra,bundler,Ruby,Rubygems,Sinatra,Bundler,我的Gemfile中有以下内容,但是当我在本地运行bundle安装时,我得到一个关于postgres不可用的错误 group :development do gem 'dm-sqlite-adapter' end group :production do gem 'dm-postgres-adapter' end 您需要告诉Bundler排除生产组: bundle install --without production 它将记住这一点,以便将来在同一台机器上运行(它将其存储在

我的Gemfile中有以下内容,但是当我在本地运行bundle安装时,我得到一个关于postgres不可用的错误

group :development do
  gem 'dm-sqlite-adapter'
end

group :production do
  gem 'dm-postgres-adapter'  
end

您需要告诉Bundler排除生产组:

bundle install --without production
它将记住这一点,以便将来在同一台机器上运行(它将其存储在
.bundle
目录中),因此您只需执行一次,以后就可以简单地执行
bundle
bundle安装