如何在 Windows 控制台中设置 RAILS

编程入门 行业动态 更新时间:2024-10-24 14:26:39
本文介绍了如何在 Windows 控制台中设置 RAILS_ENV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 Linux 和 OS X 上,我习惯于通过这样做在指定的 Rails环境"中运行 Rake 任务:

On Linux and OS X, I'm accustomed to running Rake tasks in specified Rails "environments" by doing this:

$ export RAILS_ENV=monster_island ; rake monsters:destroy_all

如果我在 Windows XP 上的 Windows 控制台中运行任务,我如何执行等效操作?

How can I do the equivalent if I'm running the task on Windows XP in a Windows console?

推荐答案

c:>set RAILS_ENV=monster_island

c:>set RAILS_ENV=monster_island

如果不带任何其他参数运行 set,您将看到设置的环境变量.在控制台中运行 set 将仅为该控制台设置该变量,并且不会跨会话或其他控制台持久存在.

If you run set without any other arguments, you will see the environment variables that are set. Running set in a console will set that variable for just that console and won't be persisted across sessions or to other consoles.

您也可以在控制面板中永久设置 - 打开系统,选择高级,然后选择环境变量(这可能会因您的 Windows 版本而略有不同).

You can also set it permanently in the Control Panel - open System, select Advanced, and then Environment Variables (this may vary slightly depending on your version of Windows).

更多推荐

如何在 Windows 控制台中设置 RAILS

本文发布于:2023-10-28 13:28:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536767.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   如何在   Windows   RAILS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!