微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby-on-rails – 即使在开发环境中,Rails环境看起来仍然停留在生产环境中

当我在我的Rails应用程序目录中运行bundle install时,Bundler会安装仅在生产组中的gem(例如heroku或pg).当我在本地运行rails服务器时,它还试图寻找在Google上具有ZERO结果的activerecord-tcp-adapter:

/Users/atestu/.rvm/gems/ruby-1.9.3-p125@global/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)

我想这个gem与heroku的生产环境有关,但是我的RAILS_ENV变量是空的.当我将它设置为开发或运行rails s -e开发时,我得到完全相同的问题.

我怎样才能更深入地研究这个问题?

编辑:这是我的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

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐