在Ruby11.1.3Build-IU#117.798中,尝试在一个使用Rails 3.2.8,Ruby1.9.3p194(35410-04-20修订版)x86_64- IDea 11.4.0的项目中使用它的插件来运行规范。
我认为这与在OS X Lion Server (10.7.5)上安装了postgres的自制版本有关,在我的path上安装的是OS X服务器版本的pg。
在Terminal.app中:
$ whereis pg_dump
/usr/bin/pg_dump
$ pg_dump -V
pg_dump (PostgreSQL) 9.1.3
$ psql -V
psql (PostgreSQL) 9.1.3
contains support for command-line editing
$ /path/to/home/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e 'puts "#{`pg_dump -V`}"'
pg_dump (PostgreSQL) 9.1.3
$ /path/to/home/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e 'puts "#{`psql -V`}"'
psql (PostgreSQL) 9.1.3
contains support for command-line editing
如果我将这个添加到我的Rakefile中:
raise "whereis pg_dump = #{`whereis pg_dump`}, pg_dump -V = #{`pg_dump -V`}, psql -V = #{`psql -V`}"
在IDea中,当我运行->调试->规范时,控制台中会显示以下内容:
/path/to/home/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /path/to/home/.rvm/gems/ruby-1.9.3-p194@some_project/gems/ruby-debug-ide-0.4.17.beta14/bin/rdebug-ide --port 51515 -- /path/to/home/.rvm/gems/ruby-1.9.3-p194@global/bin/rake spec
Testing started at 10:59 AM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta14, ruby-debug-base 0.11.30.pre10) listens on 127.0.0.1:51515
rake aborted!
whereis pg_dump = /usr/bin/pg_dump
, pg_dump -V = pg_dump (PostgreSQL) 9.0.5
, psql -V = psql (PostgreSQL) 9.0.5
(See full trace by running task with --trace)
Process finished with exit code 137
你知道为什么它会在相同的路径上为二进制文件获取不同的版本吗?
发布于 2012-10-11 16:09:47
RubyMine和终端中的PATH
是不同的。要使其与终端相同,请从终端运行RubyMine:
open -a /Applications/RubyMine.app/
另一个选项是在RubyMine运行/调试配置中指定PATH
。
相关主题:
https://stackoverflow.com/questions/12843605
复制