【问题标题】:How to import RoR project to Netbeans如何将 RoR 项目导入 Netbeans
【发布时间】:2011-02-04 15:00:24
【问题描述】:

我有一个非常简单(实际上是空的)项目,我是通过命令行中的 rails new MyProject 命令创建的。所以,我想将它导入到 NetBeans IDE。我点击“新建项目”->“RoR”->“从现有源”,在向导窗体中选择Ruby 1.9.2(而不是嵌入式JRuby)。之后我有错误[见下图]: 所以..我点击确定。然后尝试从 NetBeans 单击运行按钮运行 RoR 应用程序,我在日志面板中收到以下错误:

/home/ses/.rvm/rubies/ruby-1.9.2-p136/bin/ruby: No such file or directory -- script/server (LoadError)

那么如何处理这两个问题呢?

附言当我从控制台启动它时,我的应用程序正在运行。 我使用 ruby​​-1.9.2 和 RoR 3.0 以及 Netbeans 6.9.1 和 Ubuntu 10.10

并且,回复我的问题的评论。 是的,我执行了以下命令:

bundle install

Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.3) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.3) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.24) 
Using actionpack (3.0.3) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.15) 
Using actionmailer (3.0.3) 
Using arel (2.0.7) 
Using activerecord (3.0.3) 
Using activeresource (3.0.3) 
Using bundler (1.0.10) 
Using mysql2 (0.2.6) 
Using thor (0.14.6) 
Using railties (3.0.3) 
Using rails (3.0.3) 

bundle pack
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.3) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.3) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.24) 
Using actionpack (3.0.3) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.15) 
Using actionmailer (3.0.3) 
Using arel (2.0.7) 
Using activerecord (3.0.3) 
Using activeresource (3.0.3) 
Using bundler (1.0.10) 
Using mysql2 (0.2.6) 
Using thor (0.14.6) 
Using railties (3.0.3) 
Using rails (3.0.3) 
Updating .gem files in vendor/cache
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Updating .gem files in vendor/cache

并关注此页面http://wiki.netbeans.org/FaqRubyRakeFetchingFailed 我做了rake -D

【问题讨论】:

  • 您是否通过控制台在您的项目目录中尝试过“bunlde install”和“bundle pack”?
  • 我发现了问题所在。为了一切顺利,我为 ruby​​ 配置了平台(在 nb-form 窗口中),我有正确的宝石路径(默认情况下,NB 检测到错误的路径)。
  • 请注意,netbeans 在下一个版本中将不再支持 ruby​​。他们正在停止开发。试试 ruby​​mine,现在只需 29 美元。

标签: ruby-on-rails ruby netbeans


【解决方案1】:

这是我为使其正常工作所做的(遇到了同样的问题):

新项目 > 现有资源
工具 > Ruby 平台 > 选择 Ruby 1.9.2-p136 > Gem Manager > New Gems > rails > install
重启 netbeans
打开项目(如果尚未打开)并右键单击 > bundler > install
运行

首先,您不应该期望调试器正常工作。因为它不适用于 netbeans,而不是 rails 3(有一些 hack,但它们有问题)。
其次,Ruby on Rails Support Discontinued in NetBeans IDE。我喜欢 Netbeans 使用 rails 2.x 的方式,但我迁移到 RubyMine 是因为它支持 Rails 3

希望对你有帮助

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-11-27
  • 1970-01-01
  • 1970-01-01
  • 2011-10-12
  • 2017-01-05
  • 1970-01-01
相关资源
最近更新 更多