我已经安装了最新版本的Sublime Text 3和https://github.com/shuky19/sublime_debugger。
我按照说明操作,但是当我运行调试器时,出现以下错误:
/Users/sauron/.rvm/gems/ruby-2.1.4/gems/execjs-2.2.2/lib/execjs/runtimes.rb:65:in `from_environment': Node.js (V8) runtime is not available on this system (ExecJS::RuntimeUnavailable)
当我在命令行上直接运行'rails s'时,一切正常。
这是控制台输出。当我尝试使用浏览器向服务器发出请求时,会触发堆栈跟踪。
Started process command: bash -c "'/Users/sauron/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/ruby_executor.sh' 'rvm' True '-C/Users/sauron/git/sja' '-r/Users/sauron/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb' '-rbundler/setup' '/Users/sauron/.rvm/gems/ruby-2.1.4/bin/rails' s"
Connecting...
----------------------------------------
------------Ruby Executor---------------
----------------------------------------
Method: RVM
Using ruby version: ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-darwin13.0]
Located at: /Users/sauron/.rvm/rubies/ruby-2.1.4/bin/ruby
Ruby Arguments = -C/Users/sauron/git/sja -r/Users/sauron/Library/Application Support/Sublime Text 3/Packages/Ruby Debugger/sublime_debug_require.rb -rbundler/setup /Users/sauron/.rvm/gems/ruby-2.1.4/bin/rails s
Connected
/Users/sauron/.rvm/gems/ruby-2.1.4/gems/execjs-2.2.2/lib/execjs/runtimes.rb:65:in `from_environment': Node.js (V8) runtime is not available on this system (ExecJS::RuntimeUnavailable)
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/execjs-2.2.2/lib/execjs/runtimes.rb:50:in `autodetect'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/execjs-2.2.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/execjs-2.2.2/lib/execjs.rb:4:in `<top (required)>'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `require'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `<top (required)>'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `require'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `each'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `block in require'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `each'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `require'
from /Users/sauron/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.6/lib/bundler.rb:133:in `require'
from /Users/sauron/git/sja/config/application.rb:15:in `<top (required)>'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/sauron/git/sja/bin/rails:8:in `require'
from /Users/sauron/git/sja/bin/rails:8:in `<top (required)>'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `load'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `call'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/client/command.rb:7:in `call'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /Users/sauron/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/sauron/git/sja/bin/spring:16:in `require'
from /Users/sauron/git/sja/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Debugger stopped
答案 0 :(得分:1)
看起来我在堆栈溢出时搜索了一些答案。 请参阅:https://stackoverflow.com/a/24020042/2091901
我猜测Sublime Text 3调试器的运行时脚本会设置环境变量,并且对节点的位置有不正确的引用。
简而言之,我创建了以下符号链接,一切都很好:
ln -s /usr/local/bin/node /usr/bin/node
实际上。这并不能完全解决我的问题。我现在在处理请求时遇到此错误:
连 /Users/sauron/.rvm/gems/ruby-2.1.4/bin/rails:19:语法错误,意外'=',期待keyword_end 最后一个例外:# /Users/sauron/.rvm/gems/ruby-2.1.4/bin/rails:23:语法错误,意外的输入结束,期待keyword_end