Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialspalak
12,151 Pointsbin/rails vs rails differences?
Several commands in the Intro Rails course use "bin/rails" as the prefix, instead of rails: for example, bin/rails generate [name of model]. This tutorial uses "rails generate" instead. What is the reason for using the "bin" in front of rails commands? This is something that is rather difficult to google, for whatever reason.
Thanks
spalak
12,151 PointsHi Ross Litzenberger ,
Is the command treated any differently with bin in front? And why is it faster?
Thanks
1 Answer
Codye Watson
16,835 PointsThe reason behind bin/rails vs rails is different versions of rails. If you're running a current version of rails then it's fine to use the 'rails' command. But if you have a different version (say Rails 3.2) and you have Rails 4 installed then you need to use 'bin/rails' because you may run into issues with the 'rails' command.
Ross Litzenberger
11,706 PointsRoss Litzenberger
11,706 PointsThe reason behind the bin/rails bin/rake is for speed. Command "time bin/rails s" you will every time you pass the command. The file will load faster.