我的终端宝石环境与我的Rubymine环境不匹配。 在终端,它给出:
- EXECUTABLE DIRECTORY: /Users/george/.gem/ruby/1.9.3/bin
- SPEC CACHE DIRECTORY: /Users/george/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/george/.gem/ruby/1.9.3
- /Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1
而在RubyMine中它给出了:
EXECUTABLE DIRECTORY: /Users/george/.rubies/ruby-1.9.3-p392/bin
SPEC CACHE DIRECTORY: /Users/george/.gem/specs
RUBYGEMS PLATFORMS:
ruby
x86_64-darwin-12
GEM PATHS:
/Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1
/Users/george/.gem/ruby/1.9.1
似乎有关于宝石位置的混淆,我不知道如何解决它。
我正在使用chruby来控制安装了ruby-build的ruby版本 该应用程序是Rails 3.2.17
终端和Rubymine的完整输出如下:
终端:
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 1.9.3 (2013-02-22 patchlevel 392) [x86_64-darwin12.5.0]
- INSTALLATION DIRECTORY: /Users/george/.gem/ruby/1.9.3
- RUBY EXECUTABLE: /Users/george/.rubies/ruby-1.9.3-p392/bin/ruby
- EXECUTABLE DIRECTORY: /Users/george/.gem/ruby/1.9.3/bin
- SPEC CACHE DIRECTORY: /Users/george/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/george/.gem/ruby/1.9.3
- /Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/george/.gem/ruby/1.9.3/bin
- /Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/bin
- /Users/george/.rubies/ruby-1.9.3-p392/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
- /Users/george/bin
- /opt/X11/bin
的RubyMine:
RUBYGEMS VERSION: 2.2.2
RUBY VERSION: 1.9.3 (2013-02-22 patchlevel 392) [x86_64-darwin12.5.0]
INSTALLATION DIRECTORY: /Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1
RUBY EXECUTABLE: /Users/george/.rubies/ruby-1.9.3-p392/bin/ruby
EXECUTABLE DIRECTORY: /Users/george/.rubies/ruby-1.9.3-p392/bin
SPEC CACHE DIRECTORY: /Users/george/.gem/specs
RUBYGEMS PLATFORMS:
ruby
x86_64-darwin-12
GEM PATHS:
/Users/george/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1
/Users/george/.gem/ruby/1.9.1
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
https://rubygems.org/
SHELL PATH:
/Users/george/.rubies/ruby-1.9.3-p392/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/Users/george/bin
/opt/X11/bin
/usr/local/bin
----------------------
IDE: RubyMine 6.0.3, build #RM-133.632
OS: Mac OS X 10.9.2[x86_64]
Java: 1.6.0_65-b14-462-11M4609
RubyMine SDK Environment:
Sdk: ruby-1.9.3-p392
Sdk Version: ver.1.9.3p392 ( revision 39386) p392
Ruby Interpreter: /Users/george/.rubies/ruby-1.9.3-p392/bin/ruby
RVM Sdk: no
RVM Home: /usr/local/rvm
Sdk Language Level: 1.9
Sdk Load Path:
~/.rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1
~/.rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/x86_64-darwin12.5.0
~/.rubies/ruby-1.9.3-p392/lib/ruby/site_ruby
~/.rubies/ruby-1.9.3-p392/lib/ruby/vendor_ruby/1.9.1
~/.rubies/ruby-1.9.3-p392/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin12.5.0
~/.rubies/ruby-1.9.3-p392/lib/ruby/vendor_ruby
~/.rubies/ruby-1.9.3-p392/lib/ruby/1.9.1
~/.rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-darwin12.5.0
/Applications/RubyMine.app/rubystubs193
Sdk Gem paths:
~/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems
~/.gem/ruby/1.9.1/gems
~/.rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems
~/.gem/ruby/1.9.1/bundler/gems
答案 0 :(得分:3)
似乎RubyMine使用了错误的ruby版本。解决这个问题:
答案 1 :(得分:0)
默认情况下,RubyMine在项目根目录中搜索文件.ruby-version
,然后设置要与rvm一起使用的Ruby版本,覆盖默认的rvm配置。
要解决此问题,您有两个选择:
.ruby-version
文件编辑为所需的版本。