Rails 3——Rspec
在我的 Rails3 应用程序中,我安装了 rspec。但是当我在控制台中运行 rspec 命令时,出现以下错误。
C:\myapp>rspec spec
'rspec' is not recognized as an internal or external command,
operable program or batch file.
请帮忙。
提前致谢。
in my rails3 app I have installed rspec. But when I run the rspec command in my console it gives the following error.
C:\myapp>rspec spec
'rspec' is not recognized as an internal or external command,
operable program or batch file.
Please Help.
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以尝试
它并不能解决根本问题,但它是一个快速的解决方法
编辑:是否对你进行了一些谷歌搜索,你尝试过这个吗? http://getsatisfaction.com/railstutorial/topics/rspec_command_not_found#reply_4313182
You can try
It doesnt solve the root problem, but is a quick work-around
EDIT: Did a bit of googling for you, have you tried this? http://getsatisfaction.com/railstutorial/topics/rspec_command_not_found#reply_4313182
您需要将 ruby gems 目录添加到 PATH 环境变量中。
对我来说,这是“C:\Program Files\Ruby192\lib\ruby\gems”,但这会根据版本和安装目录而有所不同。您可以通过转到“计算机”>“将其添加到 PATH 变量”系统属性>高级系统设置>环境变量>路径>编辑。确保不要擦除现有内容。相反,添加一个分号并粘贴宝石路径。
祝你好运。
You need to add the ruby gems directory to your PATH environment variable.
For me this is "C:\Program Files\Ruby192\lib\ruby\gems", but this will vary depending on version and install directory. You can add it to your PATH variable by going to Computer > System Properties > Advanced System Settings > Environment Variable > Path > Edit. Make sure you don't wipe the existing contents. Instead, add a semi-colon and paste the gems path in.
Good luck.
我这样做了并且成功了
I did this and it worked