gug*_*son 12 postgresql ruby-on-rails heroku taps
我在将数据从我的开发数据库推送到Heroku时遇到了问题.我决定切换到PostgreSQL作为我的开发数据库并更新了database.yml并从gemfiles中删除了sqlite gem.
该应用程序运行良好对PostgreSQL但当我尝试运行命令时:
heroku db:push
Run Code Online (Sandbox Code Playgroud)
我得到一个令人费解的SQLite错误,因为我的项目中没有对sqlite的引用:
! Taps Load Error: cannot load such file -- sqlite3
! You may need to install or update the taps gem to use db commands.
! On most systems this will be:
!
! sudo gem install taps
Run Code Online (Sandbox Code Playgroud)
这是我的database.yml文件:
development:
adapter: postgresql
encoding: unicode
database: xxxx
pool: 5
timeout: 5000
username: xxxx
password: xxxx
test:
adapter: postgresql
encoding: unicode
database: test
pool: 5
timeout: 5000
username: xx
password: xx
production:
adapter: postgresql
encoding: unicode
database: test
pool: 5
timeout: 5000
Run Code Online (Sandbox Code Playgroud)
我正在使用RVM,我创造了一个没有任何运气的新宝石.
我甚至试过这个但得到了同样的SQLite错误:
heroku db:push postgres://xx:xx@localhost/xx
! Taps Load Error: cannot load such file -- sqlite3
! You may need to install or update the taps gem to use db commands.
! On most systems this will be:
!
! sudo gem install taps
Run Code Online (Sandbox Code Playgroud)
我还运行了bundle install和bundle update.
约翰
小智 10
我遇到了同样的问题并通过将我的gem文件中的水龙头移动到开发组来解决它需要sqlite,这就是导致问题的原因.
group :development do
gem 'taps', :require => false # has an sqlite dependency, which heroku hates
end
Run Code Online (Sandbox Code Playgroud)
小智 8
该解决方案不仅增加taps
宝石也是sqlite3
宝石入:development
组.如果您已经在开发中使用sqlite3
,那么只需添加taps
gem即可.但我正在使用mysql
我的开发,所以要解决这个问题我必须添加两者.
group :development do
gem 'taps'
gem 'sqlite3'
end
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3163 次 |
最近记录: |