Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails &引用;轨道s";或;轨道c";在控制台中失败:";看起来像你的应用程序';s./bin/rails是由Bundler生成的存根;_Ruby On Rails_Ruby On Rails 3 - Fatal编程技术网

Ruby on rails &引用;轨道s";或;轨道c";在控制台中失败:";看起来像你的应用程序';s./bin/rails是由Bundler生成的存根;

Ruby on rails &引用;轨道s";或;轨道c";在控制台中失败:";看起来像你的应用程序';s./bin/rails是由Bundler生成的存根;,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,这是输出。到底发生了什么事 使用Rails 3.x。我尝试过“gem清理”和“bundle安装”,但没有效果 有人遇到过这种情况吗 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, ra

这是输出。到底发生了什么事

使用Rails 3.x。我尝试过“gem清理”和“bundle安装”,但没有效果

有人遇到过这种情况吗

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>'
看起来你的应用程序的./bin/rails是由Bundler生成的存根。
在Rails 4中,应用程序的bin/目录包含版本控制的可执行文件
与任何其他源代码一样,而不是按需生成存根。
以下是如何升级:
bundle config--删除bin#关闭Bundler的存根生成器
rake rails:update:bin#使用新的rails 4可执行文件
git add bin#将bin/添加到源代码管理
您可能还需要将bin/从.gitignore中删除。
当您安装要在应用程序中使用其可执行文件的gem时,
生成并将其添加到源代码管理:
我有一个宝石的名字
git add bin/新可执行文件
警告:Gem::Specification.reset期间未解析的规范:
小型测试(~>4.2)
耙(大于等于0.8.7)
警告:清除未解析的规范。
如果这导致问题,请报告错误。
/Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:34:“设置中的块”:您已经激活了activesupport 4.0.8,但您的Gemfile需要activesupport 3.2.16。在命令前面加上“bundle exec”可以解决这个问题。(Gem::LoadError)
来自/Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:19:in'setup'
来自/Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler.rb:120:in'setup'
来自/Users/Will/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/setup.rb:7:in`'
来自/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:128:in'require'
来自/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:128:“在require中救援”
来自/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:39:in'require'
从/Users/Will/Projects/explovia/config/boot.rb:6:in`'
from/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:121:in'require'
from/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:121:in'require'
from/Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/lib/rails/app\u rails\u loader.rb:42:in`block in exec\u app\u 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`'
来自/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:69:in'require'
来自/Users/Will/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:69:in'require'
from/Users/Will/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.8/bin/rails:9:in`'
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`'

您是否尝试过通过bundle运行这些命令? 错误日志说明:

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)
所以试着像这样跑步:

> bundle exec rails c
> bundle exec rails s 

就像一只猴子在电脑上工作一样,我遵循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

我希望它对将来尝试它的每个人都有效。(当然,您需要删除注释,这些注释是在#符号之后的单词,包括#符号)

修复了它。我没有意识到这个捆绑包和控制台有任何关系,所以我打折了这条线。谢谢你的帮助,我会在10分钟内接受你的回答。@WillTaylor很高兴我能帮上忙!如果您不在控制台中通过bundler调用命令,它将使用系统上可用的任何gems,这些gems可能与gemfile中的版本不同。@Matt感谢它修复了它,但它仍然写下通知:“看起来您的应用程序的./bin/rails是bundler生成的存根……下面是如何升级”……你有没有办法永久修复?我并不特别喜欢每次使用控制台时都输入bundle exec rails c。感谢您的任何建议。@BKSpurgeon我正在使用。你也可以试试。