1

I am running into a bizarre problem. My rails console is not loading parts of my rails environment, but only in production. In development it works fine.

:~/production_code/current$ RAILS_ENV=production rbenv exec rails c
        Running via Spring preloader in process 26218
        Loading production environment (Rails 5.2.1)

ActiveRecord::Base.connection.tables
=> ["schema_migrations", "ar_internal_metadata", "markets", "delayed_jobs", "users"]
irb(main):004:0> Market
Traceback (most recent call last):
        1: from (irb):4
NameError (uninitialized constant Market)
Did you mean?  Marcel
irb(main):005:0>

I also does not understand reset! and RAILS_ROOT is undefined.

I'm really puzzled as to what's going on and not sure where to investigate from here.

1 Answer 1

4

This happens when spring is running in production. Try either:

spring stop

or look for running spring process using ps -eaf | grep spring and kill them.

Try the console again once spring is stopped successfully.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. It's been a while since I've used rails. This is new to me. I'll go read up on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.