简体   繁体   English

编辑Ruby应用程序

[英]Editing Ruby Applications

Testia Tarantula is a RoR testing suite running on Apache. Testia Tarantula是一个在Apache上运行的RoR测试套件。 After installing Ruby and Tarantula app on a CentOS server, I can access the web-based interface. 在CentOS服务器上安装Ruby和Tarantula app后,我可以访问基于Web的界面。 Usually when I want to hack something open-source like Mantis, I change some code in the apache/Mantis folder or whatever and refresh the webpage. 通常当我想破解像Mantis这样的开源软件时,我会更改apache / Mantis文件夹中的一些代码或者其他内容并刷新网页。 Even if I delete a whole wack of code, nothing seems to happen. 即使我删除了整整一堆代码,似乎也没有发生任何事情。 If I make changes to a .js file in a Ruby app (or similar file), do I need to compile? 如果我在Ruby应用程序(或类似文件)中更改.js文件,我是否需要编译?

You have to restart the server. 您必须重新启动服务器。 Rails (in production mode) precompiles the assets and it needs to be recompiled. Rails(在生产模式下)预编译资产,需要重新编译。

If you change a js file then you have to reload the page at the very least. 如果更改了js文件,则必须至少重新加载页面。 In production mode you pretty much need to restart the server if you change anything because your assets may be precompiled. 在生产模式下,如果您更改任何内容,则几乎需要重新启动服务器,因为您的资产可能已预先编译。

In development mode you don't have to restart the server for everything. 在开发模式下,您无需为所有内容重新启动服务器。 You can see changes in views and controllers without restarting but you do need to restart the server for changes to the model. 您可以在不重新启动的情况下查看视图和控制器中的更改,但您需要重新启动服务器以更改模型。

Running a local rails server is very useful from this point of view. 从这个角度来看,运行本地rails服务器非常有用。 Just type rail -s on the command line and go to localhost:3000 只需在命令行键入rail -s,然后转到localhost:3000

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM