Troubleshooting
Here we will explore common issues and their resolutions. Visit me (wayneeseguin) in #rvm on irc.freenode.net and let me help you with any issues and please leave feedback!
Before trying any solution below, please:
- Make sure that you are on the latest gem version (rvm update --head).
- Make sure that the sourcing of the RVM file occurs *last* in your profile files (.bash_profile / .bashrc / .zshrc) essentially after any customizations of PATH / functions or aliases. Also, ensure your shell file does not contain "&& return".
- Be sure to be using either bash or zsh, RVM (latest versions preferred) is untested at best in other shells.
ruby-debug and ruby 1.9
If you have trouble installing ruby-debug19 try installing with the following command:
∴ gem install ruby-debug19 -- --with-ruby-include="$rvm_src_path/$(rvm tools identifier)/"
Segfaults
If you see segfaults in 1.8.7 and 1.9.1 (possibly because of 'spec_fetcher.rb' or some other library), note this is a known bug for both ruby versions. Please see the ruby-lang.org issue for details: http://redmine.ruby-lang.org/issues/show/2597 If you downgrade to 'rvm install 1.8.7-p174' for now the issue had not been introduced at that point. You can set '1.8.7-p174' as the default patchlevel for now in ~/.rvm/config/user which overrides rvm's defaults. Please note that on 1.8.7, these bug appears to be gone as of p299. Simply set:
ruby_1.8.7_patch_level=174
i386 (32 bit)
I need to compile ruby X as i386 (32 bit).
CFLAGS='-m32' CXXFLAGS='-m32' LDFLAGS='-m32' rvm install X
Also note you may need to add the following to the start of the line on osx:
rvm_archflags="-arch i386"
Bus Error / Segfault
When a command you try to run produces a segfault, possibly like the one below:
[BUG] cross-thread violation on rb_gc()
In every case of this I have seen thus far it has always ended up being that a ruby gem/library with C extensions was compiled against a different ruby and/or architecture than the one that is trying to load it. Try uninstalling & reinstalling gems with C extensions that your application uses to hunt this buggar down.
MySQL
If you are having issues installing MySQL gem for a ruby please visit the MySQL page.
.bashrc not being loaded on OSX
If your .bashrc file isn't being correctly loaded on OSX, you need to do one of two things:
- Add "source ~/.bashrc" to ~/.bash_profile or ~/.profile
- In your terminal preferences, change the shell from the default of /usr/bin/login to /bin/bash.
Passenger
If you are having issues getting passenger running with an RVM installed ruby, most likely you missed the '.bin/[ruby string]' comment on the passenger page.
Readline
If you have an error when compiling pertaining to readline, please refer to the readline page.
require "iconv" # => false ?!
If you have issues with iconv not being available in ruby / irb please rever to the iconv page.
curl failing, 'curl is' ?!
If you see this:
++ curl is /opt/local/bin/curl -O -L -s -C - ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p383.tar.gz curl: Remote file name has no length! curl: try 'curl --help' or 'curl --manual' for more information
Then maybe you have aliased or symlinked the 'which' command to the 'type' command, revert this and RVM should work.
I can't seem to install the pg gem.
Prepend with a variable assignment for PATH with the location of the pg_config file, for example:
PATH=/Users/wayne/.dbm/postgresql-8.4.0/bin:$PATH gem install pg --no-rdoc --no-ri