Rails 3 "bundle install" is very fast (takes 1 second), but after that Rails is not? (using rvm)

I am using rvm doing the following:

rvm install ree    <--- (Ruby Enterprise Edition), or this can be 1.8.7 or 1.9.2
rvm ree
rvm gemset create 'proj'
cd path/to/proj
bundle install

therefore, the gemfile in this project says:

gem 'rails', '3.0.0'

and bundle installvery fast reporting

Using rails (3.0.0) 

but after that when i type

$ rails -v
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 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/rails:18

$ which rails
/usr/bin/rails

why bundle installdoesn't it set rails as a gem? but if I type script/rails -v, it shows that it is 3.0.0

+5
source share
2 answers

It is right. bundle installwill not install Rails as a gem in the usual sense. Now explain why.

Bundler , : ~/.bundle/<type-of-ruby>/<version>/gems. . , , . bad , . SomeGem v2, SomeGem v1? .

Bundler , ( Gemfile. rails, ( , gem install rails), Bundler ( bundle install Rails).

, Bundler, bundle exec rails , Gemfile, Rails. Bundler Rails, , bundle exec .

be , , . -,

+12

( , rvm info, do rvm ree@proj, gemset: 'proj'), . Btw, .

, -, ,

, , ( "" gem ), gem install bundler, , gem , rvm.

: .bundle, ( gem uninstall bundler?). , rvm ree @proj gem install bundler .

Yehuda , bundler, (bundler 1.0.0). , , .

0

All Articles