简体   繁体   English

我可以在测试/开发环境中运行heroku应用程序吗

[英]Can I run my heroku app in Test/Development environment

I was trying to run my test cases on heroku. 我试图在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). 基金许多博客/答案告诉如何在heroku.But运行升级/定制的环境中,每当我跑heroku run rspec spec/返回you are running production environment (没有确切的错误)。

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. 所以我的问题不是如何在heroku上运行登台/自定义环境,而是当我登录到Heroku Rails控制台时,我应该能够看到Rails.env #=> test或staging或其他内容。 Any help is appreciable. 任何帮助都是可观的。

In heroku dashboard, you should just set RAILS_ENV and RACK_ENV to test . 在heroku仪表板中,您应该只将RAILS_ENVRACK_ENV设置为test

You can do that here: 您可以在这里进行: 在此处输入图片说明

After setting these variables, I was able to start the console in test environment. 设置完这些变量后,我能够在测试环境中启动控制台。

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何确定我的 rails 是否在开发环境中而不是在测试环境中? - How can I determine if my rails is in the development environment and not the test environment? 如何从我的开发和测试环境中获取空气制动器? - How can I get airbrake out of my development and test environment? 我可以在heroku app的environment.rb中运行`git describe`吗? - can I run `git describe` in a heroku app's environment.rb? 为什么我在heroku上却出现此错误,而在我的Rails应用程序中却没有开发此错误? - Why am I getting this error on heroku but not in development in my rails app? 如何在rails开发环境中测试错误页面? - How can I test error pages in rails development environment? 在开始编写代码之前,我是否可以运行一个开发环境“清单”? - Is there a development environment 'checklist' I can run through before starting to code? 为什么我应该只在测试环境中运行我的rails app上的rspec规范,而不是dev或prod? - Why should I run rspec specs on my rails app only in a test environment, not dev or prod? 我的应用程序在Heroku上无法正常运行,在运行“ heroku run rails test”时没有错误,但是在运行“ heroku run rails console”时出现许多错误 - My app is down on Heroku, no errors when run “heroku run rails test”, but many errors on running “heroku run rails console” 手动运行服务器时,为什么不能连接到Heroku Rails应用程序? - Why can't I connect to my Heroku rails app when I run the server manually? 如何在Heroku上重置我的HOST环境变量? - How can I reset my HOST environment variable on Heroku?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM