MDA/MDD/TDD/DDD/DDDDDDD
          posts - 536, comments - 111, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          rails調(diào)試

          Posted on 2010-02-19 23:22 leekiang 閱讀(1807) 評(píng)論(0)  編輯  收藏 所屬分類: ruby
          在netbeans6.8(使用ruby1.8.6)的一個(gè)rails項(xiàng)目上右鍵點(diǎn)擊"調(diào)試",提示未安裝版本與0\.4\..*模式匹配的ruby-debug-ide 點(diǎn)擊"安裝快速調(diào)試器",出現(xiàn)如下的錯(cuò)誤:
          ------------------------------------------------------
          Building native extensions.? This could take a while...
          ERROR:? Error installing ruby-debug-ide:
          ??? ERROR: Failed to build gem native extension.

          c:/ruby/bin/ruby.exe mkrf_conf.rb
          Building native extensions.? This could take a while...

          Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9 for inspection.
          Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/ext/gem_make.out
          ------------------------------------------------------
          然后在C:\ruby\lib\ruby\gems\1.8\gems下發(fā)現(xiàn)了剛剛生成的ruby-debug-ide-0.4.9目錄和ruby-debug-base-0.10.3目錄。

          接著在cmd里gem install ruby-debug,也報(bào)錯(cuò):
          ------------------------------
          Building native extensions.? This could take a while...
          ERROR:? Error installing ruby-debug:
          ??????? ERROR: Failed to build gem native extension.

          c:/ruby/bin/ruby.exe extconf.rb
          creating Makefile
          nmake
          'nmake' 不是內(nèi)部或外部命令,也不是可運(yùn)行的程序
          或批處理文件。

          Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-bas
          e-0.10.3 for inspection.
          Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/ext/gem_
          make.out
          -------------------------------
          然后發(fā)現(xiàn)ruby-debug-base-0.10.3目錄重新生成了。

          現(xiàn)在說一下解決步驟:
          1,下載http://rubyforge.iasi.roedu.net/gems/ruby-debug-base-0.9.3-mswin32.gem
          ?? gem install ruby-debug-base-0.9.3-mswin32.gem
          2, 去http://rubyforge.org/projects/debug-commons/下載ruby-debug-ide-0.4.6.gem
          ?? gem install ruby-debug-ide-0.4.6.gem
          ?? 版本不能高于0.4.6,如果高了都報(bào)???????
          ????? ERROR: Failed to build gem native extension.
          ?? 0.4.7見ruby-debug-ide-0.4.7\ext\extconf.rb
          ?? 0.4.9見ruby-debug-ide-0.4.9\ext\mkrf_conf.rb
          ?? 0.4.6壓根就沒有ext目錄
          ?? 有人說要裝什么linecache.gem,我沒安裝。
          ?? 還有人裝了ruby-debug.gem,我也沒安裝。
          ?? 在http://rubyforge.mirrors.roedu.net/gems里能找到老版本。

          感謝http://hlee.javaeye.com/blog/576237

          在netbeans里調(diào)試時(shí)發(fā)現(xiàn)有問題,那個(gè)綠三角不能點(diǎn)多了,否則會(huì)影響后面的調(diào)試。


          另外不明白gem除了把文件拷到gems目錄下,還做了什么。



          后面都是記錄,僅供參考。
          How to enable Ruby debug in RubyMine 2.0 on Windows里說
          (If you installed Ruby with the zip binary, reinstall it using the one-click installer as found here. That's because currently the ruby debugger ide only works on Windows using a RubyInstaller installation). Also verify that Ruby's root path doesn't include spaces.
          1. ...略
          2. ...略
          3. ...略
          4. Open with a text editor the file command.rb that's part of the installed ruby-debug-ide19 gem. In my case, that file was under folder C:\Programmi\Ruby19\lib\ruby\gems\1.9.1\gems\ruby-debug-ide19-0.4.12\lib\ruby-debug
          5. Modify the beginning of procedure debug_eval (at line 120) so to enter a new statement between statements str = str.to_s and max_time = 10. The new statement to enter is:
            return "" if str == "$FILENAME"

            At the end, the procedure debug_eval should begin like this:
            def debug_eval(str, b = get_binding)
            ??begin str = str.to_s
            ??return "" if str == "$FILENAME"
            ??max_time = 10
            ??to_inspect = str.gsub(/\\n/, "\n")

          ruby-debug to Ruby 1.9
          如果使用的是ruby1.9,則Installation: IDE versionNetBeans 6.7.1 IDE updates.ruby-debug19 only works on Windows using a RubyInstaller installation,Do not install to a path that has a space inside of it.In both cases, you will also need to download and install the DevKit.
          原來在ruby-debug-ide 0.4.7 的release notes里說了原因:
          Patch by Mark Moseley supporting ruby-debug-base19.
          ? Dynamically installs right ruby-debug-base dependency depending on the
          ? version of a Ruby platform being used. ruby-debug-base19 is the only solution
          ? these days for 1.9 debugging, so might be temporary solution until ruby-debug
          ? projects brings official version.
          另外參見Ruby 2.0 Beta Issue: Error installing ruby-debug-ide19
          ??????? Debug supported for ruby 1.8.7?

          從下午弄到深夜還沒解決關(guān)于ruby-debug-ide的問題發(fā)現(xiàn)有人解決了:
          我試了下ruby1.8.6還是不行,還是報(bào)那個(gè)異常。沒法換成NetBeans6.8集成的jruby,集成的jruby中自帶ruby-debug-ide,OK了。在這里提示一下,不要選jruby.exe要選jruby.bat,希望對(duì)遇到同樣問題的人有所幫助。
          問題解決,解決步驟:1.下載rubyinstaller,安裝;2.下載devkit,解壓到根目錄后,修改 “ruby路徑”\devkit\msys\1.0.11\etc\fstab為
          “ruby路徑”/devkit/gcc/3.4.5/mingw32
          “ruby路徑”/devkit/msys/1.0.11/usr/local /usr/local
          然后在命令行窗口,gem install linecache19 這個(gè)要好長(zhǎng)時(shí)間,耐心等待。然后gem install ruby-debug-ide19,這個(gè)就快了。這就OK了,不要在rubymine中安裝ruby-debug-ide19和linecache19,會(huì)報(bào)錯(cuò)。


          某人的解決辦法:
          在RubyMine里調(diào)試提示需要安裝ruby-debug-ide,但是安裝的過程有問題,提示:
          ? ERROR: Failed to build gem native extension.
          于是想解開gem包,把里面的extension去掉。但是編輯完之后再用winrar打包gem就認(rèn)不出來了。看來壓縮的格式也很重要。于是找來了tar和gzip兩個(gè)工具,tar還好,用gzip解壓和壓縮過的文件還是認(rèn)不出來。只有另想別的辦法了。突然想到把文件解壓之后,應(yīng)該可以用gem的工具來生成一個(gè)gem安裝文件吧。于是找了一篇制作gem的教程,把extension去掉之后制作了一個(gè)gem,居然可以順序安裝了。然后重新打開 RubyMine也可以調(diào)試了。

          Trying to install ruby-debug-ide on jruby 1.2.0
          http://youtrack.jetbrains.net/issue/RUBY-5341
          好帖Ruby調(diào)試器一覽
          一個(gè)視頻
          http://netbeans.org/kb/60/ruby/debugger-screencast.html


          201010補(bǔ)充:
          根本沒有那么復(fù)雜,
          裝DevKit,把DevKit\bin設(shè)置為環(huán)境變量,然后就可以在netbean中安裝和執(zhí)行了

          主站蜘蛛池模板: 株洲县| 徐水县| 正宁县| 包头市| 象山县| 江津市| 武义县| 九龙县| 山东| 雷州市| 墨江| 曲周县| 余姚市| 遂川县| 海门市| 新建县| 南雄市| 武宣县| 易门县| 怀集县| 汤阴县| 淮滨县| 长垣县| 上杭县| 文成县| 陵川县| 遂宁市| 福安市| 谢通门县| 钟山县| 迁西县| 蒙自县| 巴彦县| 布拖县| 洪洞县| 莱阳市| 乳山市| 麻江县| 阿拉尔市| 额尔古纳市| 洪泽县|