Nishutosh Sharma
Nishutosh Sharma

Reputation: 1936

Can I run my heroku app in Test/Development environment

I was trying to run my test cases on heroku. Fund many blogs/answers telling how to run staging/custom environment on heroku.But whenever I run heroku run rspec spec/ it returns you are running production environment(not exact error).

So my qustion is not how to run staging/custom evironment on heroku but when I login into heroku rails console, I should be able to see Rails.env #=> test Or staging or whatever. Any help is appreciable.

Upvotes: 0

Views: 325

Answers (1)

user81269
user81269

Reputation: 659

In heroku dashboard, you should just set RAILS_ENV and RACK_ENV to test.

You can do that here: enter image description here

After setting these variables, I was able to start the console in test environment.

enter image description here

Upvotes: 4

Related Questions