我在某个时候重新生成了我的 binstub。以前是这样的Spring
工作完美,在我第一次打开 Rails 控制台后,控制台会立即出现。
现在看来 Spring 不再运行了。
当我输入:
rails console
我得到:
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
Loading development environment (Rails 4.2.3)
[1] pry(main)>
如果我输入:
spring rails console
我收到相同的消息,但没有出现控制台,而是返回到命令行。
我怎样才能让这个命令像在新的 Rails 应用程序中那样工作?
最佳答案
我不想删除我的整个 bin
目录,并且已经添加到 git
.所以我就跑了:
rake rails:update:bin
然后消息就消失了。
关于ruby-on-rails - 如何恢复我的 Rails 4 binstubs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33281483/