Rails on Netbeans: Uncaught exception: no such file to load — script/server or script/console

不羁岁月 提交于 2019-12-21 04:57:10

问题


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

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

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.

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)

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?

Many thanks! Amit


回答1:


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

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

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


来源:https://stackoverflow.com/questions/4188963/rails-on-netbeans-uncaught-exception-no-such-file-to-load-script-server-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!