2012-03-09 72 views
4

当我在我的Rails应用程序目录中运行bundle install,捆扎机将安装仅是生产组中的宝石(如Heroku的或PG)。当我在本地运行轨道服务器,它也试图寻找一个ActiveRecord-TCP适配器具有零个结果在谷歌:Rails环境看起来像它坚持生产,甚至在开发环境

/Users/atestu/.rvm/gems/[email protected]/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require': Please install the tcp adapter: `gem install activerecord-tcp-adapter` (cannot load such file -- active_record/connection_adapters/tcp_adapter) (LoadError) 

我想这宝石与Heroku的生产环境,但我RAILS_ENV变量空。当我将其设置为development或运行rails s -e development时,我会得到完全相同的问题。

我该如何深入研究这个问题?

编辑:这是我的Gemfile

source 'http://rubygems.org' 

gem 'rails', '3.2.1' 
gem 'json' 
gem 'jquery-rails' 
gem 'authlogic' 
gem 'acts-as-taggable-on' 
gem 'rpx_now' 
gem 'hominid' 
gem 'ruby-tmdb' 
gem 'memcached' 
gem 'aws-s3' 

group :assets do 
  gem 'sass-rails' 
  gem 'coffee-rails' 
  gem 'uglifier' 
end 

group :production do 
  gem 'heroku' 
  gem 'pg' 
end 

group :development, :test do 
  gem 'sqlite3' 
  gem 'taps' 
end 

这里是我的database.yml文件:

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 
+1

请发表您的'Gemfile'。 – jdl 2012-03-10 00:58:49

+0

请同时发布您的database.yml文件 – 2012-03-10 03:27:59

+0

这很奇怪,你确定这是你的** database.yml **文件吗?它看起来很像您的应用程序中的某个地方,您要求使用** tcp **适配器进行连接。 – 2012-03-10 12:05:34

回答

0

奇怪..可能与水龙头宝石? Removing it from the Gemfile has helped others

它在11个月内还没有开发出来,当我将它包含在我的Gemfile中时,它生成了一个Ruby 1.9.1文件夹(我使用1.9.3)和一堆宝石 - 可能是一些冲突在那里。似乎是我能找到的'tcp'的唯一参考。如果可能的话,可能值得使用pgbackups

您可能还需要考虑使用替代Heroku toolbelt包括它在Gemfile中的。

+0

刚试过删除它(甚至完全卸载它),仍然得到相同的错误... – 2012-03-12 15:05:38

1

也许您应该检查.bundle/config文件?

+0

我的.bundle /配置完整: '---' ' BUNDLE_WITHOUT:production' 我打过它,但它在'bundle install'后重新出现 – 2012-03-12 15:11:41

0

变化的database.yml:

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: postgresql 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

你可以检查:https://devcenter.heroku.com/articles/sqlite3,以获取更多信息

不要忘记代码上传到GIT。