gpt4 book ai didi

ruby-on-rails - 控制台中的 "Rails s"或 "Rails c"失败 : "Looks like your app' s ./bin/rails 是由 Bundler 生成的 stub ”

转载 作者:行者123 更新时间:2023-12-04 05:58:27 24 4
gpt4 key购买 nike

这是输出。这到底是怎么回事?

使用 Rails 3.x。我试过“ gem 清理”,然后是“捆绑安装”,但没有效果。

有没有人遇到过这个?

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:
minitest (~> 4.2)
rake (>= 0.8.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:34:in `block in setup': You have already activated activesupport 4.0.8, but your Gemfile requires activesupport 3.2.16. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:19:in `setup'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler.rb:120:in `setup'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/setup.rb:7:in `<top (required)>'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /Users/Will/Projects/explovia/config/boot.rb:6:in `<top (required)>'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/lib/rails/app_rails_loader.rb:42:in `block in exec_app_rails'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/lib/rails/app_rails_loader.rb:32:in `loop'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/lib/rails/app_rails_loader.rb:32:in `exec_app_rails'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/lib/rails/cli.rb:6:in `<top (required)>'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/bin/rails:9:in `<top (required)>'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/bin/rails:23:in `load'
from /Users/Will/.rvm/gems/ruby-2.0.0-p481/bin/rails:23:in `<main>'

最佳答案

就像猴子在电脑上工作一样,我按照 rails 输出的指令进行操作,它对我来说就像一个神圣的奇迹:

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

我希望它适用于 future 尝试它的每个人。 (当然,您需要删除注释 - 包括 # 符号之后的单词)

关于ruby-on-rails - 控制台中的 "Rails s"或 "Rails c"失败 : "Looks like your app' s ./bin/rails 是由 Bundler 生成的 stub ”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26253950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com