本文介绍了Netbeans上的Rails:未捕获的异常:无需加载此类文件-脚本/服务器或脚本/控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Netbeans 6.9.1(刚刚升级)启动Rails 3控制台,并以

I'm trying to initiate a Rails 3 console from Netbeans 6.9.1 (just upgraded) and fail with

Uncaught exception: no such file to load -- script/console

由于类似的错误(... -- script/server),调试器也会失败.

The debugger fails as well on a similar error (... -- script/server).

我要在其上运行的项目以前是我升级的Rails 2.3.8应用程序,而Netbeans仍尝试使用旧的ruby script/console命令而不是rails c.

The project I'm trying to run this on was previously a Rails 2.3.8 app which I upgraded, and Netbeans still tries to do the good old ruby script/console command rather than rails c.

我尝试安装此处描述的修补程序,但此方法无效.gem list返回:

I tried to install the patch described here, but it didn't work.gem list returns:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.1, 3.0.0.rc2)
actionpack (3.0.1, 3.0.0.rc2)
activemodel (3.0.1, 3.0.0.rc2)
activerecord (3.0.1, 3.0.0.rc2)
activeresource (3.0.1, 3.0.0.rc2)
activesupport (3.0.1, 3.0.0.rc2)
archive-tar-minitar (0.5.2)
arel (2.0.2, 1.0.1, 1.0.0.rc1)
builder (2.1.2)
bundler (1.0.5, 1.0.0.rc.6)
columnize (0.3.2)
crack (0.1.8)
erubis (2.6.6)
httparty (0.6.1)
i18n (0.4.2)
jrails (0.6.0)
linecache19 (0.5.11)
mail (2.2.9)
mime-types (1.16)
minitest (2.0.0, 1.6.0)
mysql (2.8.1 x86-mingw32)
mysql2 (0.2.6 x86-mingw32)
nokogiri (1.4.3.1 x86-mingw32)
pik (0.2.8)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.1, 3.0.0.rc2)
railties (3.0.1, 3.0.0.rc2)
rake (0.8.7)
rdoc (2.5.11, 2.5.8)
ruby-debug-base19 (0.11.24)
ruby-debug-ide (0.4.9)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.4)
sqlite3-ruby (1.3.1 x86-mingw32)
thor (0.14.4)
treetop (1.4.8)
tzinfo (0.3.23)
uuidtools (2.1.1)

我在Windows 7上使用ruby 1.9.2,将pik作为rvm的替代品.我的路径默认使用c:\ruby192\bin目录,而我的其他1.8.7 ruby​​版本也安装了Rails 3. Netbeans上的项目配置为与1.9.2 ruby​​平台一起使用,并且该平台的宝石管理器"在列表中显示了Rails 3宝石.

I'm using ruby 1.9.2 on Windows 7 with pik as an rvm alternative. My path has the c:\ruby192\bin directory as a default, and my other 1.8.7 ruby version has also Rails 3 installed. The project on Netbeans is configured to work with the 1.9.2 ruby platform, and "Gem Manager" for this platform shows the Rails 3 gem in the list.

关于如何使它起作用的任何想法?

Any thoughts on how to make it work?

非常感谢!阿米特(Amit)

Many thanks!Amit

推荐答案

我找到了解决方案!此帖子给了我一些提示.

I have found the solution! This post gave me some hints.

我的平台:ruby 1.9.2-p136,rails 3.0.3,netbeans 7.0 beta

my platform: ruby 1.9.2-p136, rails 3.0.3, netbeans 7.0 beta

文件:ruby-1.9.2-p136/gems/ruby​​-debug-ide19-0.4.12/bin/rdebug-ide:79

file: ruby-1.9.2-p136/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:79

script = ARGV.shift
Debugger::PROG_SCRIPT = (script =~ /script([\\\/])rails/ ? Dir.pwd + $1 : '') + script
puts Debugger::PROG_SCRIPT
#Debugger::PROG_SCRIPT = ARGV.shift

这篇关于Netbeans上的Rails:未捕获的异常:无需加载此类文件-脚本/服务器或脚本/控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:12