0

I am trying to install rspec 2.9.9, as I am working through a course that isn't compatible with 3. My problem is similar to this. I run the command:

sudo gem install -v '<3.0.0' rspec

and this comes up:

Successfully installed rspec-2.99.0
1 gem installed
Installing ri documentation for rspec-2.99.0...
Installing RDoc documentation for rspec-2.99.0...

Then when I use "dpkg" to check what version is installed, this is returned:

dpkg-query: package 'rspec' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

Any advice will be appreciated, thanks.

2 Answers 2

1

dpkg (as well as apt-get and aptitude) work with Ubuntu's package system while gem uses the ruby gem system.

Both can be considered "package managers", but they are not the same, they're distinct. Things installed via gem can't be found in the dpkg database and vice versa.

1
  • Thank you for your response. When I run "rake" like it says in the tutorial, it returns rake aborted! Gem::LoadError: Could not find 'rspec' (~> 2) among 65 total gem(s) Checked in 'GEM_PATH=/home/david/.rvm/gems/ruby- 2.2.1:/home/david/.rvm/gems/ruby-2.2.1@global', execute gem env` for more information /home/david/TheOdinProject/RubyProject/learn_ruby/Rakefile:2:in <top (required)>' Oct 13, 2015 at 18:16
0

Try this one In gemfile:

group :development, :test do
  gem 'rspec-rails', '~> 2.9.9'
end

Then run bundle install in console after that you need to initialize the spec/ directory with:

rails generate rspec:install

I hope it will help you. Let me now if it's work or not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .