问题描述
我正在研究Ruby on Rails项目,有时我需要运行脚本.其他人似乎都很乐意通过控制台运行自己的服务器和脚本.另一方面,我真的很想写我的代码,按一个按钮,让Aptana运行我的脚本.我希望这可以启用断点.
I'm working on a Ruby on Rails project and sometimes I need to run a script. Everyone else seems happy running their own server and scripts through the console.I on the other hand really want to write my code, press a button and have Aptana run my script. For one I hope this will enable breakpoints.
-
如何确保它知道数据库类,当前出现TableName未知名称错误. 需要'table.rb'"使我出现无法加载文件的错误.尝试使用/和\添加文件路径,使用'或"
How do I make sure it knows the database classes, currently I get TableName unknown name error. "require 'table.rb'" gets me a cannot load file error. Tried adding the file path with / and \, omitting the file extension, using ' or "
运行当前文件的热键是什么(无论按下播放按钮是什么)?或如何配置?
What is the hotkey for running current file (whatever pressing the play button is)? Or how can this be configured?
当我要求Aptana运行文件时,我想自动保存它,如何配置?
When I ask Aptana to run a file, I want to automatically save it, how can this be configured?
我发现运行当前文件的热键是Ctrl + F11,这不仅是一个令人不舒服的组合,而且Kubuntu已在使用它并破坏了:(最近,Aptana开始询问我要以哪种类型的应用程序运行代码:1. Ruby应用程序(始终选择此选项)2. Ruby应用程序(再次?)3.测试::单元测试
I have found the hotkey for running current file is Ctrl + F11, not only is this an uncomfortable combination, it's already in use by Kubuntu and breaks things :(Also recently Aptana started asking what kind of application I want to run the code as:1. Ruby Application (always choose this one)2. Ruby Application (? again...)3. Test::Unit Test
很明显,我需要改变热键的位置,使其默认情况下选择Ruby Application.
Clearly I need to change the hotkey hand have it choose Ruby Application at default.
推荐答案
我认为您不必更改默认的热键.
I don't think you have to change the default hot keys.
-
第一季度的答案:您必须配置Aptana IDE才能了解Rails项目.请参考ror_master的链接.
Answer to your Q1: You have to config your Aptana IDE to know your Rails project. please refer ror_master's link.
回答您的Q2:alt + shift + x,然后按所列选项中的1(t,x等)
Answer to your Q2: alt + shift + x , then press 1 of the listed options ( t, x, etc)
第三季度的答案:我认为您的需求不是一个好习惯.在执行任何操作(如运行单元测试)之前,请确保必须手动保存所有文件.请养成习惯.
Answer to your Q3: Your demand is not a good practice, I think. Make sure that you have to MANUALLY save all the files before you do any operations like running a unit test. Please make it as a habit.
更进一步,看来您正在使用ubuntu之类的linux操作系统?如果是这样,请忘记Aptana或其他IDE, VIM +控制台将使您满意,并且通过使用这些基本工具,您将更清楚自己所运行的内容以及部署和部署必需的环境知识.运行Rails应用程序.
Further more, it seems that you are using linux OS like ubuntu? If so, please forget Aptana or other IDEs, VIM + console will satisfy you, and by using these basic tools, you will be more clear of what you are running and the necessary environment knowledge of deploying & running Rails application.
我有3.5年的Eclipse和1年的Aptana经验,是的,它们都是出色的IDE(几乎相同),但是,大约1年前,我转向VIM,这挽救了我的性命.
I have 3.5 years of Eclipse and 1 year of Aptana experience, and yes, they are both great IDEs (almost the same), however, about 1 year ago I turn to VIM, which saved my life.
已更新:感谢您提供这么多奖金!以下是为您提供的更多提示:
UPDATED: thanks for the so much bonus scores! Here are more tips for you:
-
无论使用什么(Aptana,Eclipse,Netbeans,VIM),请记住HOTKEY很重要.
whatever you are using ( Aptana, Eclipse, Netbeans, VIM) , do remember that the HOTKEY is important.
在Apatana/Eclipse中,您应该知道以下键:
in Apatana/Eclipse, you should know these keys:
- 快速打开文件:ctrl + shift + r
- 快速打开最近的文件:ctrl + e
- 方法概述:ctrl + o
- 开关:ctrl + F6,ctrl + F7
- 从被调用的语句中检查一种方法:(将光标移至该方法,然后按)F3,或者按ctrl键,然后单击鼠标左键.
- 在Apatana for Rails中:
- quick open file: ctrl + shift + r
- quick open in recent file: ctrl + e
- method outline: ctrl + o
- switch : ctrl + F6 , ctrl + F7
- inspect a method from the statement where it was called: (move the cursor to it then press) F3, or press ctrl key then left click your mouse.
- in Apatana for Rails:
- ctrl + shift + c:快速跳转到控制器
- ctrl + shift + v:快速跳转以查看
- ctrl + shift + m:快速跳转至模型
VIM对我们来说是一个艰难的学习过程,以我的经验,前两周是最艰难的时期.记住,谷歌是你最好的老师.这是我正在使用的VIM插件:
VIM has a steep learning curve for us, in my experience, the first 2 weeks is the hardest time. Remember google is your best teacher. and here are the VIM plugins that I am using:
- autocomplpop
- fuzzy_file_finder
- greplace
- mru
- 书评人
- 项目
- 轨道
该文章值得阅读:使用VIM作为Rails IDE上的完整红宝石
这篇关于如何配置aptana以即时运行我的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!