ruby-on-rails - 如何恢复我的 Rails 4 binstubs?

标签 ruby-on-rails ruby-on-rails-4

我在某个时候重新生成了我的 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/

相关文章:

ruby-on-rails - 意外标记附近的语法错误 `('

javascript - 如何在 Ruby on Rails 应用程序中接受(并解析)www-url 编码的数据?

ruby-on-rails-4 - 如何在 Sprockets 3.0 中禁用添加 ".self."

javascript - 如何在页面更改时运行 CoffeeScript ?

ruby - heroku 'serve_static_assets' 问题

ruby-on-rails - 如何跳过 config.middleware.use 用于 Rails 5 中的特定 Controller 操作

ruby-on-rails - 在 Ruby 中返回 nil 与返回 false

ruby-on-rails - git 和 Gemfile.lock 的问题

ruby-on-rails - rails : storing datatype in a column?

ruby-on-rails - 在具有 enum_attr 的记录上调用 .all 时参数数量错误