我试图在我的服务器上进行迁移但是当我执行rake db:migrate时我得到了这个代码。我在电脑上做得很好。
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
/home/magnet/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `each'
/home/magnet/liga7/shared/bundle/ruby/1.9.1/gems/activesupport-
.....
有人知道该怎么办吗?
非常感谢
答案 0 :(得分:0)
将其添加到Gemfile
gem 'sqlite3'
然后
bundle install
rake db:create
rake db:migrate
如果它没有帮助,那么替换行
gem 'sqlite3'
与
gem 'sqlite3', '1.3.9'
并运行上述命令。 如果它没有帮助,那么如果没有安装sqlite,则在你的系统上安装sqlite并重复上述过程。
答案 1 :(得分:0)
最好你能gem pg
,因为它将支持所有数据库适配器,
添加Gemfile
gem 'pg'
然后
bundle install
然后开始迁移。