Ruby on rails 如何停止在服务器上安装sqlite3适配器:`gem install activerecord-sqlite3-adapter`

Ruby on rails 如何停止在服务器上安装sqlite3适配器:`gem install activerecord-sqlite3-adapter`,ruby-on-rails,ruby,ruby-on-rails-3,ruby-on-rails-4,amazon-ec2,Ruby On Rails,Ruby,Ruby On Rails 3,Ruby On Rails 4,Amazon Ec2,我正在以生产模式部署一个应用程序,但当我尝试完成此过程时,aways显示需要sqlite适配器,请有人知道如何停止此问题 我一直在使用RAILS\u ENV=production,但在本例中没有起作用 current$ rails generate admin_interface:setup RAILS_ENV=production DEPRECATION WARNING: Support for Rails < 4.1.0 will be dropped. (called from wa

我正在以生产模式部署一个应用程序,但当我尝试完成此过程时,aways显示需要sqlite适配器,请有人知道如何停止此问题

我一直在使用RAILS\u ENV=production,但在本例中没有起作用

current$ rails generate admin_interface:setup RAILS_ENV=production
DEPRECATION WARNING: Support for Rails < 4.1.0 will be dropped. (called from warn at /home/ubuntu/.rbenv/versions/2.2.2/lib/ruby/2.2.0/forwardable.rb:183)
/home/ubuntu/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.) (LoadError)
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'
    from /home/ubuntu/vitrineonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
当前$rails生成管理界面:setup rails\u ENV=production
弃用警告:将放弃对Rails<4.1.0的支持。(从warn at/home/ubuntu/.rbenv/versions/2.2.2/lib/ruby/2.2.0/forwardable.rb:183调用)
/home/ubuntu/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in'block in replace_gem'中:请安装sqlite3适配器:`gem install activerecord-sqlite3-adapter`(sqlite3不是捆绑包的一部分。将其添加到Gemfile.)(LoadError)
from/home/ubuntu/cristeneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active\u record/connection\u adapters/sqlite3\u adapter.rb:3:in`'
from/home/ubuntu/cristeneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in“require”
from/home/ubuntu/cristeneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/backports-3.6.8/lib/backports/std_-lib.rb:9:in“带_-backports的require_”
from/home/ubuntu/cristerneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active\u support/dependencies.rb:251:在'block in require'中
from/home/ubuntu/cristeneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active\u support/dependencies.rb:236:in'load\u dependenciency'
from/home/ubuntu/cristeneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.22/lib/active\u support/dependencies.rb:251:in“require”
from/home/ubuntu/cristerneonline/releases/10/vendor/bundle/ruby/2.2.0/gems/activerecord-3.2.22/lib/active\u record/connection\u adapters/abstract/connection\u specification.rb:50:in'resolve\u hash\u connection'

我看到的第一个问题是,您应该在命令的开头添加
RAILS\u ENV
声明,因为这将为命令的生命周期设置该变量

RAILS_ENV=production bundle exec rails generate admin_interface:setup
这可能是根本原因。(还要注意使用
bundle exec
,以确保正确加载Gemfile中指定的gemset)

如果要为shell设置它,请运行:

export RAILS_ENV=production
因此,您不必为每个命令手动设置它

第二种可能是数据库适配器配置不正确。如果这是RubyonRails应用程序,则数据库适配器在
config/database.yml
中定义。如果未指定,则可能默认为sqlite3。确保您有一个正确设置的database.yml文件

production:
  adapter: postgresql
  database: rails4_stack
  username: myusername
  password: mypassword
  pool: 5
  timeout: 5000
  encoding: utf8
  reconnect: false

我看到的第一个问题是,您应该将
RAILS\u ENV
声明放在命令的开头,因为这将为命令的生命周期设置该变量

RAILS_ENV=production bundle exec rails generate admin_interface:setup
这可能是根本原因。(还要注意使用
bundle exec
,以确保正确加载Gemfile中指定的gemset)

如果要为shell设置它,请运行:

export RAILS_ENV=production
因此,您不必为每个命令手动设置它

第二种可能是数据库适配器配置不正确。如果这是RubyonRails应用程序,则数据库适配器在
config/database.yml
中定义。如果未指定,则可能默认为sqlite3。确保您有一个正确设置的database.yml文件

production:
  adapter: postgresql
  database: rails4_stack
  username: myusername
  password: mypassword
  pool: 5
  timeout: 5000
  encoding: utf8
  reconnect: false