Browse files

Copy the bin to railties so it also works if you don't have the rails…

… gem.
  • Loading branch information...
1 parent 0a87362 commit e3053ee753c3035e9d8337680212aba525c27376 @josevalim josevalim committed Jun 28, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 railties/bin/rails
2 railties/bin/rails
@@ -0,0 +1,2 @@
+#!/usr/bin/env ruby
+require "rails/cli"

8 comments on commit e3053ee

Ruby on Rails member

As of RubyGems 1.8.10, this makes gem install prompt about overwriting the executable, and crashes bundle install. See #2400.

Ruby on Rails member

That's why we can't have nice things.


@josevalim this is why you can :-) bundler/bundler@da27033

Ruby on Rails member

The bundler fix is great, but gem install will still give a confusing prompt about rails overwriting its own stuff :'(

Ruby on Rails member

@josevalim Do you mind commenting as to why we have the bin file in both the railties gem and the rails gem? Maybe if we get to the bottom of that, we can get the rubygems team to help us out. :(

Ruby on Rails member


Added to railties so that gem can be installed independently, without pulling in possibly unwanted AR, etc.

Kept in rails because otherwise invoking rails would use the executable from old 2.3.x gem installs.

Seems safer to simply revert this for now and revisit in the gentler times of some future world.

Ruby on Rails member

Yes, JK is correct. The issue was to avoid people having the rails 2.3.x being used in case they installed Rails 2.3.x after installing 3.x.

Now that rubygems has the overriding warning, maybe we can finally remove it from the rails gem and leave it permanently in the railties. It means people will now be aware when installing an older rails version that their bin stuff is being overwritten.


Looks like rubygems took out the warning. I think to be safe you need to have the executable in both gems. :-(

See #2400

Please sign in to comment.