ruby - What means 'bin' in '$ bin/rails?' -


I am trying to comply with the tutorial "Getting Started With Engine" in Rail Guide Guide and found:

  bash: bin   

/ rail : A file or directory such as

when I try just $ rails it works fine.

I am using the command for some months, line and rail too. I know the $ sign but after that I'm confused about the meaning of "bin" I'm used to type "rail" right after $, but this tutorial says that use "bin". ..

What does bin / mean?

tl; Dr

run bundle install --binstubs and it will work 'you only have to do this once and the bundler will remember that you asked for it (for that project).

Long answer

When you install a bundle with the bundle - Binstubs , the bundler will be bundled with all your bundle-specific binstubs by bin / < / Code> will set in the subdirectory (relative to Gemfile), instead of putting them in the gemset's global bunting paths.

You usually do this:

  1. Ensure that you are running rail binstub, it's in your jammfile (a different Unlike the version that got found later in your gemset, separate from the bundler, and
  2. to improve the performance time (because it is functionally equivalent to the bundle Angel Rail < / Code> excluding a subprocess invocation from zero).

Global bustbus vs. bundler bustbus

If you type which is the rail , then you / usr / local / rvm / Gems will find a long way / Jruby-1.7.18 / bin / rails , and content of which: cat 'which rails'

  #! / Usr / bin / env jruby_executable_hooks # # This file was generated by Ruby Games # # Application 'Raillets' has been set up as part of a gem, and # this file is here to facilitate running. # 'Rubygems' version = "& gt; = 0" is required if ARGV.first str = ARGV.first str = str.dup.force_encoding ("BINARY") if str.respond_to? : Force_encoding if str = ~ / aa _ (. *) _ \ Z / version = $ 1 ARGV.shift end-end gem 'Railways', version load Gem.bin_path ('railties', 'rail', version)  bundler --binstubs , if you type  , you will see something: 

  #! / Usr / bin / env jruby # # This file was generated by Bundler # # Application 'Rail' is set as part of a gem, and # is here to facilitate the running of this file # # pathname 'ENV ['Bundle_gmeeel']] = = file. Expand_path (".. ...... Gemfile", PathName. New (__ File __). Real penetration requires 'RubyGames' to require 'Bundler / Setup' Load Jam.  < / Pre> 

The main difference is that the bin / version BUNDLE_GEMFILE sets the environment variable, and requires the bundler / setup , Which tells the bundler to talk to the gem path. bin / rails is script bundler-aware, and aware of your jamfile, this It can prepare your environment with the right bat.

I usually include Binstubs on Ginstet versions and bin / x invocations.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -