capistrano / rails

Official Ruby on Rails specific tasks for Capistrano
http://www.capistranorb.com/
MIT License
870 stars 269 forks source link

capistrano showing annoying warning in rails #171

Closed flyingboy007 closed 8 years ago

flyingboy007 commented 8 years ago

running rails command showing this annoying warning after setting up capistrano.

   Looks like your app's ./bin/rails is a stub that was generated by Bundler.

    In Rails 4, your app's bin/ directory contains executables that are versioned
    like any other source code, rather than stubs that are generated on demand.

    Here's how to upgrade:

      bundle config --delete bin    # Turn off Bundler's stub generator
      rake rails:update:bin         # Use the new Rails 4 executables
      git add bin                   # Add bin/ to source control

    You may need to remove bin/ from your .gitignore as well.

    When you install a gem whose executable you want to use in your app,
    generate it and add it to source control:

      bundle binstubs some-gem-name
      git add bin/new-executable

    WARN: Unresolved specs during Gem::Specification.reset:
          json (>= 1.7.7, ~> 1.7)
          rake (>= 0.8.7)
    WARN: Clearing out unresolved specs.
    Please report a bug if this causes problems.

Everything works fine as of now. But is it something to worry about? I found that its been reported before and I tried to resolve it as recoommended in this post..issue link

add line set :bundle_binstubs, nil
remove bin from linked dirs set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

But is not working in my case..

the gems I use are

   gem 'rails', '4.2.6'
`#In development group i have below gems`
  gem "capistrano", "~> 3.5.0"
  gem 'capistrano-rails', '~> 1.1.6'
  gem 'capistrano-rbenv', '~> 2.0.4'
  gem 'capistrano-passenger'

Am I doing something wrong here or is it safe to ignore?

mattbrictson commented 8 years ago

Did you follow the instructions to fix bin/rails as listed in the warning?

flyingboy007 commented 8 years ago

No I havent tried it.. I thought it was a bug and ignored as I dont know exactly what that commands does.. Is it ok to follow that procedure?

mattbrictson commented 8 years ago

Yes, it is exactly what you need to do in order to set up the bin directory of Rails 4 properly.

flyingboy007 commented 8 years ago

it worked..Thanks.. Any particular reason why it wont work like that by default??

mattbrictson commented 8 years ago

Bundler and Rails have historically gone back and forth with sometimes conflicting prescriptions for the bin directory, so it depends on the age of your project and your tools. Nowadays with a fresh install and the latest gems, it should be set up the right way by default when you run rails new. Older projects need to be migrated like you just did.

flyingboy007 commented 8 years ago

mine is a fresh project I setup few days back..maybe some other conflicts in my system..Anyway thank you for your time..