我遇到了分段错误。 which ruby
应该返回/ usr / local / bin吗?
maletor$ rails generate mailer ContactMailer
/Users/maletor/.rvm/gems/ruby-1.9.2-p0/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle: [BUG] **Segmentation fault**
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap
maletor$ which rails
/usr/bin/rails
maletor$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [x86_64-darwin10.4.0]
- INSTALLATION DIRECTORY: /Users/maletor/.rvm/gems/ruby-1.9.2-p0
- RUBY EXECUTABLE: /Users/maletor/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/maletor/.rvm/gems/ruby-1.9.2-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/maletor/.rvm/gems/ruby-1.9.2-p0
- /Users/maletor/.rvm/gems/ruby-1.9.2-p0@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => false
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "-n/usr/local/bin"
- REMOTE SOURCES:
- http://rubygems.org/
maletor$ echo $PATH
/Users/maletor/.rvm/gems/ruby-1.9.2-p0/bin:/Users/maletor/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/maletor/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/maletor/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
maletor$ which gem
/Users/maletor/.rvm/rubies/ruby-1.9.2-p0/bin/gem
maletor$ ls ~/.rvm/rubies/ruby-1.9.2-p0/bin/
erb gem irb rake rdoc ri ruby testrb
maletor$ rails -v
Rails 3.0.0
maletor$ which rails
/usr/bin/rails
答案 0 :(得分:29)
您的RVM安装存在问题。 which
应该返回
/Users/maletor/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
升级到最新的RVM安装。 1.0版本中有一个带有“shell路径缓存”的错误。
$ rvm get head
$ rvm reload
$ rvm repair all
$ rvm use 1.9.2