Aptana 找不到 Ruby 可执行文件
当我尝试运行任何 ruby 代码时,会弹出一个窗口,显示“启动differences2.rb”遇到了问题。无法找到 Ruby 可执行文件。
我从 Aptana 内部运行“gem 环境”时,我得到以下信息:
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.6
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /home/adamar/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/adamar/.rvm/gems/ruby-1.9.2-p290
- /home/adamar/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
当 从 Aptana 内部运行“ruby -v”,我得到:
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
当我从 Aptana 内部运行“rvm use 1.9.2”时,我得到:
rvm use 1.9.2
Using /home/adamar/.rvm/gems/ruby-1.9.2-p290
在每个命令之后我重新启动并再次尝试,我也尝试过这个:
rvm use 1.9.2 --default
任何人都可以对我能做什么提出建议吗?
When I try to run any ruby code, I get a pop up that Says "Launching differences2.rb' has encountered a problem. Unable to find a Ruby executable.
When I run 'gem environment' from inside Aptana I get this:
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.6
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /home/adamar/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /home/adamar/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/adamar/.rvm/gems/ruby-1.9.2-p290
- /home/adamar/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
When I run 'ruby -v' from inside Aptana I get this:
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
When I run 'rvm use 1.9.2' from inside Aptana I get :
rvm use 1.9.2
Using /home/adamar/.rvm/gems/ruby-1.9.2-p290
I restarted and tried again after each of those commands, I also tried this:
rvm use 1.9.2 --default
Can anyone make a suggestion as to what I can do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从您的问题中不清楚您正在使用哪个版本的 Aptana。如果您使用的是 Aptana Studio 3.x,那么它应该会获取 .bashrc 中的环境设置和典型的 shell 设置。我们基本上只是在 PATH 中搜索 ruby 可执行文件的位置。在 IDE 的终端视图内部和 IDE 外部查看“
echo $PATH
”的输出以查看它们是否不同会很有用。然而,当您在 shell 中运行“ruby -v
”命令时,它似乎已经找到了它,所以我不太清楚问题可能是什么。您可以尝试在“首选项”>“调试级别日志记录”中打开调试级别日志记录。阿普塔纳工作室>故障排除。您可以将日志级别提高到“全部”,和/或选中“调试特定组件”并检查
com.aptana.core/debug
和com.aptana.core/debug/shell
条目。这应该能够揭示出底层运行的进程以及所使用的命令留置参数、可执行文件和环境的底层细节。您可以通过转到“帮助”> 查看日志。阿普塔纳>查看日志文件。当用户在 http://jira.appcelerator 提交错误时,我们通常会要求提供此日志的内容.org/secure/CreateIssue!default.jspaIt's not clear from your question which version of Aptana you're using. If you're using Aptana Studio 3.x, then it should pick up your environment setup in .bashrc and your typical shell setup. We basically just search PATH for the location of the ruby executable. It'd be useful to see the output of "
echo $PATH
" inside the Terminal view in the IDE and outside the IDE to see if they differ. However it seems like it's already finding it when you run the "ruby -v
" command in the shell, so I'm not really clear on what the issue might be.You can try turning on debug level logging inside Preferences > Aptana Studio > Troubleshooting. You can up the log level to "All", and/or check "Debug specific components" and check the
com.aptana.core/debug
andcom.aptana.core/debug/shell
entries. That should hopefully spit out low level details on what process get run under the hood and the command lien args, executables and environment used. You can view the log by going to Help > Aptana > View Log File. We typically ask for the contents of this log when users file bugs at http://jira.appcelerator.org/secure/CreateIssue!default.jspa我遇到了同样的问题,并通过从我的 PATH 中删除对 Cygwin 的所有引用来“解决”它。当 Cygwin 进入并更改您的路径时,它一定无法正确解析它。
I had the same problem and "solved" it by removing all references to Cygwin from my PATH. It must not be parsing it correctly when Cygwin goes in and changes your path.
我在使用 rvm 的 Ubuntu 上工作时遇到了同样的问题,因此我创建了一个符号链接,例如 sudo ln -s ~/progs/Aptana\ Studio\ 3/AptanaStudio3 /usr/local/bin/aptana 和从终端执行 aptana &
I had the same problem working on Ubuntu with rvm, so I created a symbolic link, like
sudo ln -s ~/progs/Aptana\ Studio\ 3/AptanaStudio3 /usr/local/bin/aptana
and from a terminal executeaptana &
尝试进入 Aptana 安装文件夹并编辑文件“studio3”。
将其添加到乞求中
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # 将 RVM 作为函数加载到 shell 会话中
这将强制它在打开 Aptana 时加载您的 rvm 路径。然后你可以使用 ./studio3 运行打开它
我注意到运行时
Try going to the folder where Aptana is installed and edit the file "studio3".
Add this in the begging
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function
This will force it to load your rvm path when opening Aptana. You can then run open it by using ./studio3
I noticed that when running
Aptana 终端在启动时加载 .aptanarc 而不是 .bashrc。您可以像这样调整 rbenv 的路径配置,
我在另一个站点上找到了这个,它帮助我的 Apatana 找到了 ruby 可执行文件。我想引用作者,但没有名字。
Aptana terminal loads the .aptanarc instead of .bashrc on start up. You can adjust the path configurations for rbenv like this
I found this on another site and it helped my Apatana find the ruby executable. I would cite the author, but there is no name.