RVM | Obtrusive gems in the global gemset - rvm

Every time I install a Ruby version using RVM, the program also installs some of the default gems to the global gemset.
For example, after installing the version 2.1.0 of Ruby:
€ rvm install 2.1.0
I get the following default gems:
€ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.3)
bundler (1.5.1)
bundler-unload (1.0.2)
executable-hooks (1.2.6)
gem-wrappers (1.2.3)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.2)
rake (10.1.0)
rdoc (4.1.0)
rubygems-bundler (1.4.2)
rvm (1.11.3.8)
test-unit (2.1.0.0)
As it turned out, in addition to installing rubies RVM always installs the gems which is specified in the file ~/.rvm/gemsets/global.gems to the global gemset (source). Some of the aforementioned gems really are in the file. However, when I remove all the gems from it, the program anyway installs the following:
*** LOCAL GEMS ***
bigdecimal (1.2.3)
gem-wrappers (1.2.3)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.2)
rake (10.1.0)
rdoc (4.1.0)
test-unit (2.1.0.0)
Why RVM installs all of those gems? What is the necessity of their presence in the system? How can I specify for RVM not to install them after installing a Ruby version?
Debian GNU/Linux 6.0.7
RVM 1.25.12

this gems are part of ruby distribution:
bigdecimal (1.2.3)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.2)
rake (10.1.0)
rdoc (4.1.0)
test-unit (2.1.0.0)
this gem is part of rvm and is required for rvm to function properly:
gem-wrappers (1.2.3)

Related

Heroku error when deploying Rails app

I need help with the following error. I'm trying to deploy Rails 4 app on Heroku..
It seems like gems can't be installed. Whan can I do about it?
I've tried to solve this using some "googling" solutions but nothing seems to work. And yes I have put sqlite and postgresql in the right group in gemfile (production/developement).
Any thoughts?
Here is the bash procedure when deploying:
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Installing i18n (0.6.9)
Installing multi_json (1.9.2)
Installing minitest (4.7.5)
Installing rake (10.3.1)
Installing builder (3.1.4)
Installing thread_safe (0.3.3)
Installing erubis (2.7.0)
Installing tzinfo (0.3.39)
Installing mime-types (1.25.1)
Installing rack (1.5.2)
Installing polyglot (0.3.4)
Installing activerecord-deprecated_finders (1.0.3)
Installing arel (4.0.2)
Installing coffee-script-source (1.7.0)
Installing execjs (2.0.2)
Installing chunky_png (1.3.1)
Installing thor (0.19.1)
Installing commonjs (0.2.7)
Installing orm_adapter (0.5.0)
Installing hike (1.2.3)
Installing bcrypt (3.1.7)
Installing json (1.8.1)
Using bundler (1.5.2)
Installing libv8 (3.16.14.3)
Installing tilt (1.4.1)
Installing rails_serve_static_assets (0.0.2)
Installing rails_stdout_logging (0.0.3)
Installing ref (1.0.5)
Installing sass (3.2.19)
Installing activesupport (4.0.2)
Installing rack-test (0.6.2)
Installing warden (1.2.3)
Installing treetop (1.4.15)
Installing coffee-script (2.2.0)
Installing rdoc (4.1.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking for sndfile.h in /opt/local/include,/usr/local/include,C:/Program Files (x86)/Mega-Nerd/libsndfile/include,C:/Program Files/Mega-Nerd/libsndfile/include... no
checking for sf_open() in -lsndfile-1... no
checking for sf_open() in -lsndfile... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/ruby-2.0.0/bin/ruby
--with-sndfile-dir
--without-sndfile-dir
--with-sndfile-include
--without-sndfile-include=${sndfile-dir}/include
--with-sndfile-lib
--without-sndfile-lib=${sndfile-dir}/
--with-sndfile-1lib
--without-sndfile-1lib
--with-sndfilelib
--without-sndfilelib
extconf.rb:21:in `<main>': Can't find libsndfile (http://www.mega-nerd.com/libsndfile/) (RuntimeError)
Try passing --with-sndfile-dir or --with-sndfile-lib and --with-sndfile-include
options to extconf. If there are spaces in the path on windows, it may not work.
Gem files will remain installed in /tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/bundle/ruby/2.0.0/gems/ruby-audio-1.6.1 for inspection.
Results logged to /tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/bundle/ruby/2.0.0/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out
Installing uglifier (2.5.0)
Installing less (2.5.0)
Installing pg (0.17.1)
An error occurred while installing ruby-audio (1.6.1), and Bundler cannot
continue.
Make sure that `gem install ruby-audio -v '1.6.1'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Installing i18n (0.6.9)
Installing multi_json (1.9.2)
Installing minitest (4.7.5)
Installing rake (10.3.1)
Installing builder (3.1.4)
Installing thread_safe (0.3.3)
Installing erubis (2.7.0)
Installing tzinfo (0.3.39)
Installing mime-types (1.25.1)
Installing rack (1.5.2)
Installing polyglot (0.3.4)
Installing activerecord-deprecated_finders (1.0.3)
Installing arel (4.0.2)
Installing coffee-script-source (1.7.0)
Installing execjs (2.0.2)
Installing chunky_png (1.3.1)
Installing thor (0.19.1)
Installing commonjs (0.2.7)
Installing orm_adapter (0.5.0)
Installing hike (1.2.3)
Installing bcrypt (3.1.7)
Installing json (1.8.1)
Using bundler (1.5.2)
Installing libv8 (3.16.14.3)
Installing tilt (1.4.1)
Installing rails_serve_static_assets (0.0.2)
Installing rails_stdout_logging (0.0.3)
Installing ref (1.0.5)
Installing sass (3.2.19)
Installing activesupport (4.0.2)
Installing rack-test (0.6.2)
Installing warden (1.2.3)
Installing treetop (1.4.15)
Installing coffee-script (2.2.0)
Installing rdoc (4.1.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking for sndfile.h in /opt/local/include,/usr/local/include,C:/Program Files (x86)/Mega-Nerd/libsndfile/include,C:/Program Files/Mega-Nerd/libsndfile/include... no
checking for sf_open() in -lsndfile-1... no
checking for sf_open() in -lsndfile... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/ruby-2.0.0/bin/ruby
--with-sndfile-dir
--without-sndfile-dir
--with-sndfile-include
--without-sndfile-include=${sndfile-dir}/include
--with-sndfile-lib
--without-sndfile-lib=${sndfile-dir}/
--with-sndfile-1lib
--without-sndfile-1lib
--with-sndfilelib
--without-sndfilelib
extconf.rb:21:in `<main>': Can't find libsndfile (http://www.mega-nerd.com/libsndfile/) (RuntimeError)
Try passing --with-sndfile-dir or --with-sndfile-lib and --with-sndfile-include
options to extconf. If there are spaces in the path on windows, it may not work.
Gem files will remain installed in /tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/bundle/ruby/2.0.0/gems/ruby-audio-1.6.1 for inspection.
Results logged to /tmp/build_55f006e8-de4b-4dcc-9c81-39f56d6f8f04/vendor/bundle/ruby/2.0.0/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out
Installing uglifier (2.5.0)
Installing less (2.5.0)
Installing pg (0.17.1)
An error occurred while installing ruby-audio (1.6.1), and Bundler cannot
continue.
Make sure that `gem install ruby-audio -v '1.6.1'` succeeds before bundling.
Failed to install gems via Bundler.
Push rejected, failed to compile Ruby app
To git#heroku.com:quiet-waters-5319.git
[remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:quiet-waters-5319.git'
seems heroku isn't able to build the native parts of required ruby-audio. After a quick search on "ruby-audio heroku" I found this: https://github.com/khurramzaman/ruby-audio-heroku

Deploy ROR to heroku fails due to sqlite3 fails

I've try the method from others post, but still cannot solve it.
I push my file to heroku but it have some error to the sqlite3.
After I install it, it still didn't work.
Below is my code
Counting objects: 82, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (82/82), 3.00 MiB | 238 KiB/s, done.
Total 82 (delta 4), reused 0 (delta 0)
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.4)
Installing i18n (0.6.4)
Installing multi_json (1.7.3)
Installing activesupport (3.2.11)
Installing builder (3.0.4)
Installing activemodel (3.2.11)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.5)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.2)
Installing tilt (1.4.1)
Installing sprockets (2.2.2)
Installing actionpack (3.2.11)
Installing mime-types (1.23)
Installing polyglot (0.3.3)
Installing treetop (1.4.12)
Installing mail (2.4.4)
Installing actionmailer (3.2.11)
Installing arel (3.0.2)
Installing tzinfo (0.3.37)
Installing activerecord (3.2.11)
Installing activeresource (3.2.11)
Installing coffee-script-source (1.6.2)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.3)
Installing json (1.8.0)
Installing rdoc (3.12.2)
Installing thor (0.18.1)
Installing railties (3.2.11)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.2.1)
Using bundler (1.3.2)
Installing rails (3.2.11)
Installing sass (3.2.9)
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_2ghtqnawaxqqm/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7 for inspection.
Results logged to /tmp/build_2ghtqnawaxqqm/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:peaceful-reef-2102.git
! [remote rejected] master -> master (pre-receive hook declined)
And this is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I don't know what happen, please help me!
Heroku doesn't support sqlite, you need to add pg gem (postgres) and remove sqlite gem

rails gem incompatibility clearance & railties, what should I do?

I have rails 3.017, and clearance 1.0.0.rc2 and trying to install gem 'jquery-rails', '~> 2.1'
Do I need an older version of jquery-rails? If so, how can I figure this out?
thanks
Joel
Bundler could not find compatible versions for gem "railties":
In Gemfile:
jquery-rails (~> 2.1) ruby depends on
railties (< 5.0, >= 3.1.0) ruby
clearance (= 1.0.0.rc2) ruby depends on
railties (3.0.17)
Yes, you need an older version of this gem. If you don't specify a certain version of jquery-rails in your Gemfile, Bundler will find the matching version for you, if you run bundle install.
You can find out the dependencies of a gem with the gem manager:
$ gem dependency jquery-rails -v 2.1.3

What's wrong with Bundler working with RubyGems to push a Git repo to Heroku?

I've made sure that all the files are in the root of the repository as recommended in this discussion. However, as I follow the instructions in this section of the book, I can't get through the section without the problems. What do you think is happening with my system that's causing the error? I have no clue at the moment of what the problem means despite reading the following in the log. Thanks in advance for your help!
stanley#ubuntu:~/rails_sample/first_app$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 96, done.
Compressing objects: 100% (79/79), done.
Writing objects: 100% (96/96), 28.81 KiB, done.
Total 96 (delta 22), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.pre
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Installing rake (0.9.2.2)
Installing i18n (0.6.0)
Installing multi_json (1.3.5)
Installing activesupport (3.2.3)
Installing builder (3.0.0)
Installing activemodel (3.2.3)
Installing erubis (2.7.0)
Installing journey (1.0.3)
Installing rack (1.4.1)
Installing rack-cache (1.2)
Installing rack-test (0.6.1)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.1.3)
Installing actionpack (3.2.3)
Installing mime-types (1.18)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.4.4)
Installing actionmailer (3.2.3)
Installing arel (3.0.2)
Installing tzinfo (0.3.33)
Installing activerecord (3.2.3)
Installing activeresource (3.2.3)
Installing coffee-script-source (1.3.3)
Installing execjs (1.3.2)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.7.3) with native extensions
Installing rdoc (3.12)
Installing thor (0.14.6)
Installing railties (3.2.3)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.0.2)
Using bundler (1.2.0.pre)
Installing rails (3.2.3)
Installing sass (3.1.18)
Installing sass-rails (3.2.5)
Installing sqlite3 (1.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_3tplrxvj7qa81/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_3tplrxvj7qa81/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:growing-mountain-2788.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:growing-mountain-2788.git'
------Gemfile------------------------
As requested, here's the auto-generated gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
Heroku tries to use postgres automatically. (good thing, as sqlite is NOT suitable for prosuction)
The sqlite scripts are compatible with postgres, so no change is required.
Do this in your Gemfile :
gem "sqlite3", :groups => [:development, :test]
gem "pg", groups => [:production]
Be aware that there might be behavior differences between sqlite and postgres. It is strongly recommended to use postgres on your development environment
see https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
The problem is missing headers files to sqlite3 on the server and gem cannot build the extension. Do you need sqlite? Try remove it from Gemfile or if this is possible install sqlite3-dev package on the server.
I had this same problem, the problem went away when I completed my push to GitHub.
I needed to complete this step:
$ git remote add origin ...
$ git push -u origin master
After that it pushed to heroku without any problems.
Replace the SQLite gem with postgres's pg gem. Heroku uses Postgres and you don't need SQLite in production mode anyway.
Replace sqlite in your Gemfile with 'gem pg'
Heroku use PostgreSQL, not SQLite.
Follow this instructions to solve your problem https://devcenter.heroku.com/articles/rails3

Rake gems:install yields error when following declarative authorization Railscast

I'm following Railstcast #188 to get declarative authorization running on my Rails 3 app (using Ruby 1.9.2) and am running into an issue getting the gem to install.
Ryan suggests adding it in config/environment.rb with the following:
config.gem "declarative_authorization", :source => "http://gemcutter.org"
Then install it with sudo rake gems:install.
However when I try that I get an error:
/Users/Travis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:314:in `bin_path': can't find gem rake ([">= 0"]) with executable rake (Gem::GemNotFoundException)
I tried rake gems:install, but got this error:
Don't know how to build task 'gems:install'
The instructions to install declarative_authorization at GitHub recommend a different process, which I also followed but still couldn't get past rake:gems install.
Does anyone know what may be happening so I can get around this?
UPDATE: Here's what my config/environment.rb looks like:
RVM -v: rvm 1.10.0-pre
Gem list:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.9, 3.0.5)
actionpack (3.0.9, 3.0.5)
activemodel (3.0.9, 3.0.5)
activerecord (3.0.9, 3.0.5)
activeresource (3.0.9, 3.0.5)
activesupport (3.0.9, 3.0.5)
addressable (2.2.6)
arel (2.0.10)
aws-s3 (0.6.2)
aws-sdk (1.3.2)
builder (2.1.2)
bundler (1.0.21 ruby)
cocaine (0.2.1, 0.2.0)
erubis (2.6.6)
faraday (0.7.6, 0.7.5)
fastercsv (1.5.4)
gemcutter (0.7.1)
heroku (2.14.0)
httparty (0.8.1)
i18n (0.6.0, 0.5.0)
jquery-rails (1.0.19, 1.0.16)
json (1.6.5)
launchy (2.0.5)
mail (2.2.19)
metaclass (0.0.1)
mime-types (1.17.2)
mocha (0.10.3, 0.10.2, 0.10.0)
multi_json (1.0.4)
multi_xml (0.4.1)
multipart-post (1.1.4)
nifty-generators (0.4.6)
nokogiri (1.5.0)
paperclip (2.5.2, 2.5.0, 2.4.5)
pg (0.12.2, 0.12.0, 0.11.0)
polyamorous (0.5.0)
polyglot (0.3.3)
rack (1.2.5, 1.2.4)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9, 3.0.5)
railties (3.0.9, 3.0.5)
rake (0.9.2.2, 0.9.2, 0.8.7)
rake-compiler (0.7.9)
ransack (0.6.0, 0.5.8)
rdoc (3.8)
rest-client (1.6.7)
rubyzip (0.9.5)
simple_oauth (0.1.5)
sqlite3 (1.3.5, 1.3.4)
sqlite3-ruby (1.3.3)
term-ansicolor (1.0.7)
thor (0.14.6)
treetop (1.4.10)
twitter (2.1.0, 2.0.2)
tzinfo (0.3.31, 0.3.30)
uuidtools (2.1.2)
xml-simple (1.1.1)
Not sure how your environment is set up, but simply installing rake should do it. If you provide more detail (rvm, bundler, etc.) it may be of help.
gem install rake
Upon further inspection of your path, I see you're using RVM. If your paths are installed properly, you can either use the RVM Global gemset, execute the line above.
Another suggestion I have is checking out the CanCan railscast as that is the bigger norm for authorization these days, more supporters as well.
http://railscasts.com/episodes/192-authorization-with-cancan
"A few episodes ago we covered Declarative Authorization. While it is an excellent authorization plugin for Rails it can be a little heavy for simpler sites. After writing the Railscast on Declarative Authorization Ryan Bates looked for an alternative solution and, failing to find one that suited his needs, decided to write his own, CanCan." - RBates
After seeing your environment, let's try to separate the environments a little. Do this.
rvm gemset create some_other_name
rvm gemset use some_other_name
bundle install
See if this isolates your environment enough.
EDIT: I don't use rake gems:install anymore. You have bundler installed, and I'm assuming you want to use it. I do use rails g gemname:install when the documentation for such exists, I'm going to look at the railscasts again and see what rbates is telling you.
On the CANCAN github page, it says: In Rails 3, add this to your Gemfile and run the bundle command.
gem "cancan".