Ruby on Rails 3: bundle install keeps failing with NoMethodErrors - ruby-on-rails

Whenever I try to make a new Rails project and run bundle install, I get errors like this:
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:253:in `fetch_all_remote_specs': undefined method `list' for #<Gem::SpecFetcher:0x8da5cc0> (NoMethodError) from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:234:in `block in remote_specs' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `each' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `remote_specs' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:165:in `fetch_specs' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/source.rb:70:in `specs' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:176:in `block (2 levels) in index' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `each' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `block in index' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/index.rb:7:in `build' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:174:in `index' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:168:in `resolve' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/definition.rb:102:in `resolve_remotely!' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/installer.rb:43:in `run' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/installer.rb:8:in `install' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start' from
/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>' from
/.rvm/gems/ruby-1.9.3-p551/bin/bundle:23:in `load' from
/.rvm/gems/ruby-1.9.3-p551/bin/bundle:23:in `<main>' from
/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval' from
/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'
I already tried a lot, including completely uninstalling and purging rails, ruby and rvm from my system (even deleting leftover files and references to rvm in config files), but it always fails at this step. I tried bundler versions from 1.0.0 through 1.6.4, the latter one accidentally, Ruby 1.9.2, 1.9.3 and 2.1, Rails 3.0.1, 3.0.2 and 3.2.6 The method it failes at varied somewhat through my different attempts, but the listed directory is always the same. .rvm is located in my home directory, which I omitted for privacy reasons.
I'm using Ruby on Rails 3.0.2 with Ruby 1.9.3 (documentation was cheap.) on Bunsenlabs, a debian distribution. I issued the following commands to install ruby and rails and create my project:
\curl -sSL https://get.rvm.io | bash -s stable --without-gems="rvm rubygems-bundler"
rvm install 1.9.3
rvm reload
rvm --default use 1.9.3
gem install rails --version 3.0.2
rails new railsapp3 -T
cd railsapp3
bundle install
( bundler ~>1.0.0 is the required version for rails 3.0.2)
This is the content of that project's gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.2'
gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'
This same method works without a hitch on my old laptop (same OS). I suspected it had something to do with version conflicts with different ruby installations, but I purged it thoroughly the last time I tried this.
I would really appreciate it if someone could give me a hint on how to resolve this!
EDIT:
For any poor soul who runs into this issue and stumbles upon this post, copypasting this gemfile (apparently for rails 3.1.0) sorta worked:
ruby on rails 3 tutorial gemfile

Related

How to install a Rails application when using RVM?

I've followed instructions from this question on SO to set up RVM, rubies and gem lists.
I have created rubies 1.8.7 and 1.9.3. For the ruby 1.8.7 I have created a gemset called Organisator.
I have activated the 1.8.7 ruby and gemset "Organisator".
I navigated to the folder of my app and tried to run bundle install. I assume that's how I'm supposed to install the gems needed for my app, same way I did when I did not have RVM.
Error message I get:
root#user-VirtualBox:/home/user/RoR/testapp# bundle install
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- openssl (LoadError)
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/https.rb:102
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:135:in `fetch'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:163:in `fetch_dependency_remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:122:in `fetch_remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:70:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:234:in `remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `remote_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:165:in `fetch_specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/source.rb:70:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/lazy_specification.rb:53:in `__materialize__'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:86:in `materialize'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `map!'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `materialize'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:127:in `specs'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:122:in `resolve_remotely!'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:48:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:12:in `install'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/cli.rb:220:in `install'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/base.rb:386:in `start'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/gems/bundler-1.1.2/bin/bundle:13
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/bin/bundle:19:in `load'
from /usr/local/rvm/gems/ruby-1.8.7-p358#organizators/bin/bundle:19
I also get an error message when I try to create a new app:
root#user-VirtualBox:/home/user/RoR# rails new testapp
/usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30:in `require': no such file to load -- active_support (LoadError)
from /usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30
from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16:in `require'
from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16
I assume I've done something wrong when setting up RVM.
The only idea I have right now is installing all the gems from my gemfile and adding them to gemfile manually.
Versions
Ruby 1.8.7-p358
Rails 2.3.1.4
RVM 1.10.3
Ubuntu 11.10
please use the "quick fix" from here https://rvm.io/packages/openssl/
you have to ignore the rest of instructions, they are intended for systems that do not support packages (like osx)

Rails 3.2.0 rspec debugger not working

I've just upgraded to ruby 1.9.3-p0 and rails 3.2.0. I'm now trying to debug an error in one of my tests using
rspec spec -d
But I get this error:
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:422:in `rescue in debug=': (RuntimeError)
**************************************************
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_threadptr_data_type - /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so
If you have it installed as a ruby gem, then you need to either require
'rubygems' or configure the RUBYOPT environment variable with the value
'rubygems'.
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `<top (required)>'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `require'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `debug='
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
/home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
**************************************************
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:407:in `debug='
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from /home/map7/.rvm/gems/ruby-1.9.3-p0#rails3.2/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
Install the new debugger gem that works with Ruby 1.9.3 and 1.9.2:
https://github.com/cldwalker/debugger
Stick this in your Gemfile:
# one-liner to install these properly: bash < <(curl -L https://raw.github.com/gist/1333785)
gem 'linecache19', '0.5.13'
gem 'ruby-debug-base19', '0.11.26'
You'll need to run that one-liner in order for bundler to pick up the proper gems.
EDIT: I forgot to link to the posts I used to get debugging working:
ruby-debug with Ruby 1.9.3?
ruby-debug19 on ruby-1.9.3-preview1
I guess I can't comment on other answers yet, but I found many of these instructions don't mention you'll still need to include the
gem 'ruby-debug19', :require => 'ruby-debug'
line in your Gemfile, in addition to the instructions siannopollo provides. Without this, I get a 'cannot load such file -- ruby-debug' error (OSX, rvm, 1.9.3-p125).
FWIW, the gist is hardcoded to 1.9.3-p0, so if you're on 1.9.3-p125, you might need to edit it (also, generally a bad idea to execute a gist you haven't read).
For me, all it took was:
gem 'debugger'
in the Gemfile
Had to upgrade the following
bundle update ruby-debug-base19

uninitialized constant ActiveSupport::Dependencies::Mutex

I try to run a working rails project from OSX to Debian. I use on both systems RVM and created the same gemsets and rvmrc for the project. On Debian I installed only ruby with rvm no system installation of ruby exists.
when I jump in the project folder rvm is switching to version 1.8.7 and is using the project gemset everything looks fine.
But when I fire up a rake -T I get this error:
$ rake -T --trace
(in /home/i/project/src)
rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/activesupport-2.3.5/lib/active_support.rb:56
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rails-2.3.5/lib/tasks/misc.rake:18
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rails-2.3.5/lib/tasks/rails.rb:4
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rails-2.3.5/lib/tasks/rails.rb:4:in `each'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rails-2.3.5/lib/tasks/rails.rb:4
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/home/i/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/i/ws/project/src/Rakefile:10
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/ home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/gems/rake-0.8.7/bin/rake:31
/home/i/.rvm/gems/ruby-1.8.7-p249#project/bin/rake:19:in `load'
/home/i/.rvm/gems/ruby-1.8.7-p249#project/bin/rake:19
For me, adding require 'thread' didn't work either.
The problem was solved by downgrading rubygems to 1.4.2:
It's a compatibility issue between newer versions of rubygems (in my case, 1.8.5) and old versions of rails (in my case 2.3.5)
$ gem install rubygems-update -v='1.4.2'
$ gem uninstall rubygems-update -v='1.8.5'
$ update_rubygems
My working solution. Add the following line:
require 'thread'
At the first line of Rakefile in your rails project root. And magically all will run ;-)
I ran into this myself not too long ago. If you google for it you'll find a couple of blog and mailing list posts advising you to explicitly require "threads" in your environment.rb. However this did not work for me, but downgrading rubygems did:
sudo gem update --system 1.3.7
Some of the posts also mention upgrading to a newer version of Rails, which was not an option in our case at the moment.
you can solve it by upgrading rails
gem install rails --version 2.3.11
or downgrade gem
sudo gem update --system 1.5.3

RoR Bundler problem

I installed everything from the bottom up and thought it was working fine until I ran a bundle install
Has anyone ever seen this? Any ideas? Please help. Thanks.
bundle install
Fetching source index for http://rubygems.org/
/usr/local/lib/ruby/1.9.1/rubygems/format.rb:38:in `from_file_by_path': Cannot load gem at [/usr/local/lib/ruby/gems/1.9.1/cache/rake-0.8.7.gem] in /home/ec2-user/anotherApp (Gem::Exception)
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/source.rb:73:in `fetch'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:45:in `block in run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `block in each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>'
from /usr/local/bin/bundle:19:in `load'
from /usr/local/bin/bundle:19:in `<main>'
If you install Ruby 1.9.2-x from source it still installs the gems to /usr/local/lib/ruby/gems/1.9.1/... which is a bit of a WTF (relevant). I too got this error but it can also be caused by a permissions issue. So try running the command again as root (assuming you're running into this on a *nix system). Yes, that is not ideal however you may find it works and at least you can keep on going on the path to figuring things out (and it's all in a test VM anyway, right?).
It's not recommended to use Ruby 1.9.1 with Rails. Better 1.8.7 or 1.9.2, see http://rubyonrails.org/download. Looks like you use the Debian/Ubuntu Ruby. 1.8.7 is available and usable in Debian/Ubuntu, install the ruby-full meta package via apt. Or compile Ruby 1.9.2 directly or via the Ruby Version Manager (rvm). Do not install rubygems via apt.

Problem with rails when trying to do rails-v

My friend just shared me this new application and I pulled it from heroku
I was just trying to do rails -v and I got
denniss$ rails -v
/Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:132:in `block in resolve': Could not find gem 'selenium-webdriver', required by 'capybara', in any of the sources (Bundler::VersionConflict)
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:130:in `catch'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/resolver.rb:130:in `resolve'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:153:in `resolve'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:93:in `specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:137:in `specs_for'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/definition.rb:126:in `requested_specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:11:in `setup'
from /Users/denniss/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.5/lib/bundler.rb:95:in `setup'
from /Users/denniss/Sites/mogo-production/config/boot.rb:5:in `<top (required)>'
from script/rails:8:in `require'
from script/rails:8:in `<main>'
Edit:
I did "bundle check" and I got this
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:214:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem'
from /usr/bin/bundle:18
Edit2:
Okay, the most up to date error that I gate after successfully installing rmagick is this. I was able to do rake db:create and migrate. I tried to do rails server (using rails3) and I get this error
/Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing': uninitialized constant ActiveSupport::CoreExtensions (NameError)
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/facebooker-1.0.74/lib/facebooker/adapters/adapter_base.rb:6
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/facebooker-1.0.74/lib/facebooker.rb:259
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:64:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:64:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:62:in `each'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:62:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:51:in `each'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:51:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0.rc.5/lib/bundler.rb:107:in `require'
from /Users/denniss/Sites/mogo-production/config/application.rb:5
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:28:in `require'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:28
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:27:in `tap'
from /Users/denniss/.rvm/gems/ree-1.8.7-2010.02/gems/railties-3.0.0.rc/lib/rails/commands.rb:27
from script/rails:9:in `require'
from script/rails:9
The application requires a gem that isn't installed, in this case "selenium-webdriver." Try bundle check to see if there are additional errors, then proceed to install the gems you're missing.
Edit from comments:
In your first code block you're using MRI 1.9, then you moved on to MRI 1.8 and now you're suddenly using REE. That tells me that you've got (at least) three different Ruby interpreters on your computer, which isn't making your life easier. In all likelyhood, you've got gems all over the place as well. Do you have previous experience with RVM? If not, my suggestion would be to remove RVM, stick with one Rails interpreter (system default, MRI 1.8) and go from there.
Installing rmagick is nearly a rite of passage for Rails developers. It's horrifying at first, but ultimately not that complicated. What the gem really wants to see during native compilation is an install of ImageMagick.
On Linux, I've usually had good luck with whatever package manager is in use. sudo apt-get install imagemagick for example.
If you are on OS X, then it's a bit more work. I've used port several times, and most recently brew to install ImageMagick. If you're on OS X, then head for Google and search for instructions with whatever package management system you happen to be using.

Resources