2

谁能帮我解决这个问题...实际上rails控制台在Windows命令提示符下崩溃...我可以运行示例应用程序服务器但无法运行此rails控制台...请帮助我...提前致谢..

错误是

看起来您的应用程序./bin/rails是由 Bundler 生成的存根。

在 Rails 4 中,您的应用程序bin/目录包含与任何其他源代码一样版本化的可执行文件,而不是按需生成的存根。

以下是升级方法:

  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

您可能还需要从 .gitignore 中删除 bin/。

当你安装一个你想在你的应用程序中使用其可执行文件的 gem 时,生成它并将其添加到源代码管理中:

  bundle binstubs some-gem-name
  git add bin/new-executable


WARN: Unresolved specs during Gem::Specification.reset:
      rake (>= 0.8.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activa
ted activesupport 4.0.0.rc1, but your Gemfile requires activesupport 3.2.8. Using bundle exec may solve this. (Gem::Load
Error)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
        from D:/Rasool_Projects/Project_4/sample_app/config/boot.rb:6:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:106:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:106:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.0.0.rc1/lib/rails/app_rails_loader.rb:42:in `block in exec_a
pp_rails'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.0.0.rc1/lib/rails/app_rails_loader.rb:32:in `loop'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.0.0.rc1/lib/rails/app_rails_loader.rb:32:in `exec_app_rails'

        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.0.0.rc1/lib/rails/cli.rb:6:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.0.0.rc1/bin/rails:9:in `<top (required)>'
        from C:/Ruby193/bin/rails:23:in `load'
        from C:/Ruby193/bin/rails:23:in `<main>'
4

2 回答 2

0

这个警告说:You have already activa ted activesupport 4.0.0.rc1, but your Gemfile requires activesupport 3.2.8. Using bundle exec may solve this

您只需更新 railsgem update rails即可安装依赖项 activesupport 等。

在更新您的 Gemfile 之前,删除Gemfile.lock

于 2013-05-05T16:46:17.543 回答
-2

开始使用 RVM。将项目的 gem 放在单独的 gemset 中,或者只创建一个 .rvmrc。你永远不会遇到这样的问题。

但是,我曾经遇到过同样的错误,卸载 gem 并手动重新安装它对我有用。

卸载gem:

gem uninstall <gem_name>

如果系统上有该 gem 的多个版本,它将提示删除该版本。

然后,安装一个 gem:

gem install <gem_name_with_version>
于 2013-05-05T19:54:47.780 回答