开发者

Ruby, RVM version messup and not picking up right versions

开发者 https://www.devze.com 2023-04-08 00:18 出处:网络
Here is my terminal output. Anand@luckydev:~ $ which ruby /usr/local/bin/ruby Anand@luckydev:~ $ rvm list

Here is my terminal output.

 Anand@luckydev:~ $ which ruby
/usr/local/bin/ruby
 Anand@luckydev:~ $ rvm list

rvm rubies

   jruby-1.6.2 [ darwin-x86_64-java ]
   ruby-1.8.7-p334 [ x86_64 ]
=> ruby-1.9.2-p180 [ x86_64 ]

 Anand@luckydev:~ $ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.3.2]

This is the problem I have. I'm running MacOSX Lion. And when I run system ruby, it gives me this.

 Anand@luckydev:~ $ which ruby
/usr/local/bin/ruby
 Anand@luckydev:~ $ ruby -e "puts 'hello'"
hello

But when I run using rvm ruby,

 Anand@luckydev:~ $ rvm use 1.9.2-p180
Using /Users/Anand/.rvm/gems/ruby-1.9.2-p180
dyld: Library not loaded: /Users/lakshman/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.1.9.1.dylib
  Referenced from: /Users/Anand/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
  Reason: image not found
ruby-1.9.2-p180 Anand@luckydev:~ $ ruby -e "puts 'hello'"
dyld: Library not loaded: /Users/lakshman/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.1.9.1.dylib
  Referenced fr开发者_JAVA技巧om: /Users/Anand/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
  Reason: image not found
Trace/BPT trap: 5
dyld: Library not loaded: /Users/lakshman/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.1.9.1.dylib
  Referenced from: /Users/Anand/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
  Reason: image not found

My home directory used to be /Users/lakshman. I changed it to /Users/Anand. I updated ~/.rvmrc to reflect the new rvm_path also.

 Anand@luckydev:~ $ cat .rvmrc
export rvm_path="/Users/Anand/.rvm"

When I use system ruby, things are fine. But when I start using rvm, it throws me error that it cannot pickup that library file pointed by DYLD_LIBRARY_PATH (I assume from error message).

How do i update it to take it from /Users/Anand. I tried setting it manually by exporting DYLD_LIBRARY_PATH to take the new path. But this didn't help.

Also, I don't think this is gonna be manually set. rvm must be setting this automatically as I switch between different rubies.

Please help.....


I think you have to remove the .rvm folder and rebuild your rvm installation/rubies. The binary ruby is linked against an absolute path that is no longer existent. I'd just do that and take the opportunity to install ruby 1.9.2 290 which has some performance increases.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号