How to restore Rails 4 backups?

I restored my binstubs at some point. It used to be thought to Springwork flawlessly, and after I first created the Rails console, the console would appear instantly.

Now it seems that Spring is no longer working.

When I type:

rails console

I get:

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

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

Here how to upgrade:

  bundle config --delete bin    # Turn off Bundler 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

Loading development environment (Rails 4.2.3)
[1] pry(main)> 

If I print:

spring rails console

I get the same message, but instead of coming to the console, I just go back to the command line.

How can I make this command work like it does in a new Rails application?

+4
source share
1 answer

I did not want to delete the entire directory bin, and it has already been added to git. So I just ran:

rake rails:update:bin

.

+14

Source: https://habr.com/ru/post/1612753/


All Articles