The Rails environment looks like it's stuck in production, even in a development environment

When I run bundle install in my Rails application directory, the Bundler installs gems only in the production group (e.g. heroku or pg). When I start the rail server locally, it also tries to find the activerecord-tcp adapter that has Google’s ZERO results:

 /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) 

I believe this stone is related to the production environment of the hero, but my RAILS_ENV variable is empty. And I get the same problem when I install it on development or when I run rails s -e development .

How can I better understand this problem?

Edit: here is my 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 

And here is my database.yml file:

 # 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 
+4
source share
3 answers

Maybe you should check the .bundle/config file?

+1
source

Wierd .. Perhaps related to gems? Removing from Gemfile helped other users .

It has not been developed in more than 11 months, and when I included it in my Gemfile, it generated a ruby ​​1.9.1 folder (and I use 1.9.3) with a bunch of gems - there may be some conflicts there. This seems to be the only tcp link I can find. It might be worth using pgbackups if possible.

You may also consider using the Heroku toolbelt instead of including it in the Gemfile.

0
source

change database.yml:

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

to

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

you can check: https://devcenter.heroku.com/articles/sqlite3 for more information

Remember to upload the code to GIT.

0
source

Source: https://habr.com/ru/post/1400673/


All Articles