我以前在我的系统上安装了ruby 1.8.7。一段时间我安装了rvm。从那时起,这是一个巨大的混乱。例如,尝试启动Sinatra服务器会导致:
/home/yoni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rack (>= 0) amongst [bundler-1.1.3, faraday-0.8.4, koala-1.5.0, multi_json-1.3.6, multipart-post-1.1.5, rake-0.9.2.2, rubygems-bundler-0.9.0, rvm-1.11.3.3] (Gem::LoadError)
我知道这是两个ruby安装的结果,因此有两个gem文件的位置,但我不知道如何解决这个问题。我不介意完全删除ruby 1.8.7,但是我想这样做而不会破坏任何东西。
有什么想法吗?
更新:dpkg --get-selections | grep ruby
的结果为:
libdataobjects-mysql-ruby1.8 install
libdataobjects-postgres-ruby1.8 install
libdataobjects-ruby1.8 install
libdataobjects-sqlite3-ruby1.8 install
libdbd-mysql-ruby install
libdbd-mysql-ruby1.8 install
libdbd-sqlite3-ruby1.8 install
libdbi-ruby1.8 install
libdeprecated-ruby1.8 install
libmysql-ruby install
libmysql-ruby1.8 install
libopenssl-ruby install
libopenssl-ruby1.8 install
libruby1.8 install
libruby1.9.1 deinstall
libsqlite3-ruby install
libsqlite3-ruby1.8 install
ruby-dev install
ruby1.8-dev install
答案 0 :(得分:4)
apt-get --purge remove packagename
来自dkpg --list | grep ruby
显示的所有不在下面列表中的内容:
来自rvm requirements
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
如果无法从CLI使用,请使用synaptic包管理器: