RVM不会使用我在新shell中使用的Ruby版本

时间:2017-02-20 23:14:02

标签: ruby-on-rails ruby ubuntu rvm

使用Ubuntu 14.04。我正在尝试从2.0.0升级到Ruby 2.3.3。安装似乎没问题,但是当我开始新的终端时,它拒绝使用2.3.3。

我尝试了很多修复程序,但在每次修复后,重新启动终端并运行ruby -v会返回“ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

我尝试运行rvm --default use ruby-2.3.3,这使我的终端使用2.3.3,但是当我重新启动终端时它又恢复到2.0.0。

我尝试运行rvm reset,它没有做任何事情并返回以下错误消息:

$ rvm reset
Warning! PATH is not properly set up, '/home/user/.rvm/gems/ruby-2.0.0-p648/bin' is not at first place.
         Usually this is caused by shell initialization files. Search for 'PATH=...' entries.
         You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'.
         To fix it temporarily in this shell session run: 'rvm use ruby-2.0.0-p648'.
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

我尝试运行rvm get stable --auto-dotfiles,它提供了一个没有错误的长输出,以

结尾
Upgrade Notes:

  * No new notes to display.

RVM reloaded!

但是再一次,没有任何改变。

我尝试将[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"添加到我的.bachrc文件的底部。

然而,没有任何改变。

任何人都有其他想法吗?

这是一些命令及其输出:

$ rvm list
Warning! PATH is not properly set up, '/home/user/.rvm/gems/ruby-2.0.0-p648/bin' is not at first place.
         Usually this is caused by shell initialization files. Search for 'PATH=...' entries.
         You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'.
         To fix it temporarily in this shell session run: 'rvm use ruby-2.0.0-p648'.
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

rvm rubies

=> ruby-2.0.0-p648 [ x86_64 ]
   ruby-2.3.0 [ x86_64 ]
 * ruby-2.3.3 [ x86_64 ]

# => - current
# =* - current && default
#  * - default


$ which ruby
/home/user/.rvm/rubies/ruby-2.0.0-p648/bin/ruby



$ which rvm
/home/user/.rvm/bin/rvm

另外,这是我的rvm调试:

$ rvm debug
Warning! PATH is not properly set up, '/home/user/.rvm/gems/ruby-2.0.0-p648/bin' is not at first place.
         Usually this is caused by shell initialization files. Search for 'PATH=...' entries.
         You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'.
         To fix it temporarily in this shell session run: 'rvm use ruby-2.0.0-p648'.
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

ruby-2.0.0-p648:


rvm 1.29.1 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]

ruby-2.0.0-p648:

  system:
    uname:        "Linux user-U230 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Wed Jun 12 10:22:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux"
    name:         "Ubuntu"
    version:      "14.04"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)"
    zsh:          " => not installed"
    remote path:  "ubuntu/14.04/x86_64"

  rvm:
    version:      "rvm 1.29.1 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]"
    updated:      "3 hours 4 minutes 2 seconds ago"
    path:         "/home/user/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.0.0p648"
    date:         "2015-12-16"
    platform:     "x86_64-linux"
    patchlevel:   "2015-12-16 revision 53162"
    full_version: "ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]"

  homes:
    gem:          "/home/user/.rvm/gems/ruby-2.0.0-p648"
    ruby:         "/home/user/.rvm/rubies/ruby-2.0.0-p648"

  binaries:
    ruby:         "/home/user/.rvm/rubies/ruby-2.0.0-p648/bin/ruby"
    irb:          "/home/user/.rvm/rubies/ruby-2.0.0-p648/bin/irb"
    gem:          "/home/user/.rvm/rubies/ruby-2.0.0-p648/bin/gem"
    rake:         "/home/user/.rvm/gems/ruby-2.0.0-p648/bin/rake"

  environment:
    PATH:         "/usr/local/heroku/bin:/home/user/instadvantage:/home/user/.rvm/gems/ruby-2.0.0-p648/bin:/home/user/.rvm/gems/ruby-2.0.0-p648@global/bin:/home/user/.rvm/rubies/ruby-2.0.0-p648/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/user/.rvm/bin:/home/user/.rvm/bin:/home/user/.rvm/bin:/home/user/.rvm/bin:/home/user/.rvm/bin:/home/user/.rvm/bin:/home/user/.rvm/bin"
    GEM_HOME:     "/home/user/.rvm/gems/ruby-2.0.0-p648"
    GEM_PATH:     "/home/user/.rvm/gems/ruby-2.0.0-p648:/home/user/.rvm/gems/ruby-2.0.0-p648@global"
    MY_RUBY_HOME: "/home/user/.rvm/rubies/ruby-2.0.0-p648"
    IRBRC:        "/home/user/.rvm/rubies/ruby-2.0.0-p648/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
  PATH:
/usr/local/heroku/bin:/home/user/instadvantage:/home/user/.rvm/gems/ruby-2.0.0-p648/bin:/home/user/.rvm/gems/ruby-2.0.0-p648@global/bin:/home/user/.rvm/rubies/ruby-2.0.0-p648/bin
  uname -a: Linux user-U230 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  permissions: /home/user/.rvm:
total 152
drwxrwxr-x 26 user user  4096 Feb 20 17:01 .
drwxr-xr-x 50 user user 12288 Feb 20 17:01 ..
drwxrwxr-x  2 user user  4096 Feb 20 17:01 archives
drwxrwxr-x  2 user user  4096 Feb 20 17:01 bin
drwxrwxr-x  3 user user  4096 Feb 20 17:01 config
drwxrwxr-x  3 user user  4096 Apr  2  2016 contrib
drwxrwxr-x  2 user user  4096 Apr  2  2016 docs
drwxrwxr-x  2 user user  4096 Feb 20 17:01 environments
drwxrwxr-x  2 user user  4096 Apr  2  2016 examples
drwxrwxr-x  2 user user  4096 Apr  2  2016 gem-cache
drwxrwxr-x  7 user user  4096 Feb 19 14:32 gems
drwxrwxr-x  4 user user  4096 Feb 20 17:01 gemsets
drwxrwxr-x  4 user user  4096 Apr  2  2016 help
drwxrwxr-x  2 user user  4096 Apr  2  2016 hooks
-rw-rw-r--  1 user user    11 Feb 20 17:01 installed.at
drwxrwxr-x  3 user user  4096 Apr  2  2016 lib
-rw-rw-r--  1 user user   643 Feb 20 17:01 LICENSE
drwxrwxr-x 20 user user  4096 Feb 20 16:53 log
drwxrwxr-x  3 user user  4096 Apr  2  2016 man
drwxrwxr-x 11 user user  4096 Apr  2  2016 patches
drwxrwxr-x  6 user user  4096 Apr  2  2016 patchsets
-rw-rw-r--  1 user user  9799 Apr  2  2016 README
-rw-rw-r--  1 user user 11065 Feb 20 17:01 README.md
-rw-rw-r--  1 user user     7 Feb 20 17:01 RELEASE
drwxrwxr-x  5 user user  4096 Feb 20 16:53 rubies
drwxrwxr-x  5 user user  4096 Apr  2  2016 scripts
drwxrwxr-x  3 user user  4096 Feb 20 16:45 share
drwxrwxr-x  3 user user  4096 Apr  2  2016 src
drwxrwxr-x  2 user user  4096 Feb 19 14:32 tmp
drwxrwxr-x  2 user user  4096 Feb 20 17:01 user
-rw-rw-r--  1 user user     7 Feb 20 17:01 VERSION
drwxrwxr-x  2 user user  4096 Feb 20 16:53 wrappers

/home/user/.rvm/rubies:
total 20
drwxrwxr-x  5 user user 4096 Feb 20 16:53 .
drwxrwxr-x 26 user user 4096 Feb 20 17:01 ..
lrwxrwxrwx  1 user user   33 Feb 20 16:53 default -> /home/user/.rvm/rubies/ruby-2.3.3
drwxrwxr-x  6 user user 4096 Apr  2  2016 ruby-2.0.0-p648
drwxrwxr-x  6 user user 4096 Apr  2  2016 ruby-2.3.0
drwxrwxr-x  6 user user 4096 Feb 19 14:32 ruby-2.3.3

/home/user/.bashrc:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$PATH:$HOME/.rvm/bin"
/home/user/.bash_profile:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
/home/user/.rvm/config/alias \(filtered\):
default=ruby-2.3.3

/home/user/.rvm/config/db \(filtered\):
# General
default_ruby=ruby
interpreter=ruby
niceness=0
#
# RVM
#
rvm_remote_server_path1=downloads
rvm_remote_server_url1=https://s3.amazonaws.com/jruby.org
rvm_remote_server_url2=https://rubies.travis-ci.org
rvm_remote_server_url=https://rvm_io.global.ssl.fastly.net/binaries
#
# RubyGems
#
gem_gem-empty_version=>=1.1.2
gem_gem-wrappers_version=>=1.2.7
gem_rdoc_version=>=4.1.1
gem_rvm_version=>=1.11.3.9
rubygems_repo_url=https://github.com/rubygems/rubygems.git
rubygems_url=https://rubygems.org/rubygems
rubygems_url_fallback_1=https://github.com/rubygems/rubygems/archive/v#.tar.gz
rubygems_url_fallback_1_pattern=https://rubygems.org/rubygems/rubygems-([[:digit:]\.]+).tgz
rubygems_version=latest-2.6
#
# Packages
#
autoconf_url=https://ftp.gnu.org/gnu/autoconf
curl_url=https://github.com/bagder/curl/archive
gettext_url=https://ftp.gnu.org/pub/gnu/gettext
glib_url=http://ftp.gnome.org/pub/gnome/sources/glib/2.23
libiconv_url=https://ftp.gnu.org/pub/gnu/libiconv
libxml2_url=ftp://xmlsoft.org/libxml2
libxslt_url=ftp://xmlsoft.org/libxslt
llvm_url=https://llvm.org/svn/llvm-project/llvm/trunk
mono_url=http://ftp.novell.com/pub/mono/sources/mono
ncurses_url=https://ftp.gnu.org/pub/gnu/ncurses
openssl_url=https://www.openssl.org/source
openssl_version=1.0.1i
pkg-config_url=http://pkgconfig.freedesktop.org/releases
readline_url=https://ftp.gnu.org/gnu/readline
yaml_url=http://pyyaml.org/download/libyaml
yaml_version=0.1.6
zlib_url=https://prdownloads.sourceforge.net/libpng
#
# CentOS / Fedora EPEL
#
epel5_i386_rpm=https://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
epel5_x86_64_rpm=https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
epel6_i386_rpm=https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
epel6_x86_64_rpm=https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
epel7_x86_64_rpm=https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
#
# MRI Ruby
#
CentOS_5_ruby_1.8.7_patch_level=p374
CentOS_5_ruby_1.8.7_patch_level_warn=Warning, Centos 5 can not build head version of ruby, falling back to latest patchlevel, your ruby will be less secure because of this.
CentOS_5_ruby_1.9.2_patch_level=p320
CentOS_5_ruby_1.9.2_patch_level_warn=Warning, Centos 5 can not build head version of ruby, falling back to latest patchlevel, your ruby will be less secure because of this.
ruby_1.8.4_rubygems_version=1.3.5
ruby_1.8.5_patch_level=p231
ruby_1.8.5_rubygems_version=1.3.5
ruby_1.8.6_patch_level=p420
ruby_1.8.6_rubygems_version=1.3.7
ruby_1.8.7_patch_level=head
ruby_1.8.7_rubygems_version=latest-2.0
ruby_1.9.1_patch_level=p431
ruby_1.9.1_rubygems_version=latest-1.8
ruby_1.9.2_patch_level=p330
ruby_1.9.3_patch_level=p551
ruby_2.0.0_patch_level=p648
ruby_head_rubygems_version=head
ruby_repo_url=https://github.com/ruby/ruby.git
ruby_unmaintained_date=2016-02-24
ruby_unmaintained_version=2.0.0
ruby_url=https://cache.ruby-lang.org/pub/ruby
ruby_url_fallback_1=https://ftp.ruby-lang.org/pub/ruby
ruby_version=2.4.0
#
# REE
#
ree_1.8.6_patch_level=20090610
ree_1.8.6_repo_url=https://github.com/FooBarWidget/rubyenterpriseedition.git
ree_1.8.6_rubygems_version=1.3.7
ree_1.8.6_url=http://rubyforge.org/frs/download.php/58677
ree_1.8.7_2010.02_url=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rubyenterpriseedition/ruby-enterprise-1.8.7-2012.02.tar.gz
ree_1.8.7_patch_level=2012.02
ree_1.8.7_repo_url=https://github.com/FooBarWidget/rubyenterpriseedition187-330
ree_1.8.7_rubygems_version=latest-2.0
ree_1.8.7_url=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rubyenterpriseedition
ree_configure_flags=--dont-install-useful-gems
ree_version=1.8.7
#
# Rubinius
#
rbx_1.0.0_patch_level=20100514
rbx_1.0.1_patch_level=20100603
rbx_1.1.0_patch_level=20100923
rbx_1.1.1_patch_level=20101116
rbx_1.2.0_patch_level=20101221
rbx_1.2.1_patch_level=20110215
rbx_1.2.2_patch_level=20110222
rbx_1.2.3_patch_level=20110315
rbx_1.2.4_patch_level=20110705
rbx_2.0.0_url=https://s3.amazonaws.com/releases.rubini.us
rbx_repo_url=https://github.com/rubinius/rubinius.git
rbx_url=https://s3.amazonaws.com/asset.rubini.us
rbx_version=3.71
#
# MRuby
#
mruby_repo_url=https://github.com/mruby/mruby.git
mruby_url=https://github.com/mruby/mruby/archive
mruby_version=1.2.0
#
# JRuby
#
jruby_repo_url=https://github.com/jruby/jruby.git
jruby_url=https://s3.amazonaws.com/jruby.org/downloads
jruby_version=9.1.7.0
maven_version=3.3.3
#
# MacRuby
#
macruby_0.10_url=http://macruby.macosforge.org/files
macruby_nightly_url=http://macruby.jp/files/nightlies
macruby_repo_url=https://github.com/MacRuby/MacRuby.git
macruby_url=https://github.com/downloads/MacRuby/MacRuby
macruby_version=0.12
#
# Maglev
#
maglev_repo_url=https://github.com/MagLev/maglev.git
maglev_url=http://seaside.gemtalksystems.com/maglev
maglev_version=head
#
# IronRuby
#
ironruby_1.1.3_url=https://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=ironruby&DownloadId=217153&FileTime=129445296766130000&Build=19727
ironruby_repo_url=https://github.com/ironruby/ironruby.git
ironruby_version=1.1.3
#
# Topaz
#
topaz_repo_url=https://github.com/topazproject/topaz.git
topaz_url=https://d3sgc2zfsedosj.cloudfront.net
topaz_version=head

gem sources:
https://rubygems.org/

1 个答案:

答案 0 :(得分:4)

rvm remove ruby-2.0.0-p648
rvm remove ruby-2.3.0

重启bash

rvm --default use ruby-2.3.3

它的工作