[英]How do you add a ruby file to an existing project in Eclipse 3.6 using the Dynamic Languages Toolkit (DLTK)?
I've installed the Dynamic Languages Toolkit (DLTK) in Eclipse 3.6. 我已经在Eclipse 3.6中安装了Dynamic Languages Toolkit(DLTK)。 But I can't figure out how to create a Ruby file in an existing Java project.
但是我不知道如何在现有的Java项目中创建Ruby文件。
Doing the obvious thing (New -> Empty Ruby Script) just gives the error message "Source folder is not a correct project". 做明显的事情(新建->空Ruby脚本)只会给出错误消息“源文件夹不是正确的项目”。 Do I have to modify the project in some way to tell DLTK that it's OK to add Ruby files to it?
我是否必须以某种方式修改项目以告知DLTK可以向其中添加Ruby文件?
(Adding the file outside of Eclipse does work.) (在Eclipse外部添加文件确实可以。)
Do the following steps (has worked for me): 请执行以下步骤(对我有用):
New file
and enter in the dialog the filename my_file.rb
. New file
选择要保存红宝石文件的目录,然后在对话框中输入文件名my_file.rb
。 The essential part is the extension, because this will ensure that the ruby mechanisms are in place. def
and press CTRL-SPACE
, you should see as a result the list with def - method definition
(the template), def
and defined?
def
并按CTRL-SPACE
,结果将看到带有def - method definition
(模板), def
和defined?
. So it is possible to mix java and ruby files in the same project, that has as nature java. 因此,可以将java和ruby文件混合在同一个项目中,该项目具有java的性质。 The only thing I has noticed is that the run menu entry only allows you to start the dialog
Run As > Run Configurations...
and enter there the necessary parameters to start your ruby script. 我唯一注意到的是,运行菜单项仅允许您启动对话框
Run As > Run Configurations...
并在其中输入必要的参数以启动ruby脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.