机架依赖性阻止精简启动

发布于 2024-12-26 19:49:42 字数 1604 浏览 6 评论 0原文

    .rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.4.0, 
but your Gemfile requires rack 1.2.5. Using bundle exec may solve this. (Gem::LoadError)

是当我尝试在任何应用程序上运行 Thin start 、 Bundle exec Thin、 Rails 时出现的错误。我尝试运行系统级和应用程序级捆绑包更新/安装,删除 gemfile.lock 并再次更新。 Sudo 级别安装。没有什么。

有什么建议吗?

这是我的宝石文件:

source 'http://rubygems.org'

gem 'rails', '3.0.10'
gem 'rake', '0.8.7'
gem 'jquery-rails', '0.2.6'
gem 'pg', :require => 'pg'
gem 'devise'
gem 'nifty-generators'
gem 'mocha'
gem 'thin'
gem 'omniauth'
require 'oauth2'
gem 'fb_graph'
gem 'nokogiri'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'

group :development do
gem 'rspec-rails', '2.5.0'

gem 'faker', '0.9.5'
end 

group :test do
gem 'rspec', '2.5.0'
gem 'webrat', '0.7.1' 
gem 'spork', '0.9.0.rc5'
gem 'factory_girl_rails', '1.0'
end

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'

# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end
    .rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.4.0, 
but your Gemfile requires rack 1.2.5. Using bundle exec may solve this. (Gem::LoadError)

Is the error that I get when I try to run thin start , bundle exec thin, rails s on any of my apps. I have tried running system level and app level bundle updates/ installs, removing gemfile.lock and updating again. Sudo level installs. Nothing.

Any advice?

This is my gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.10'
gem 'rake', '0.8.7'
gem 'jquery-rails', '0.2.6'
gem 'pg', :require => 'pg'
gem 'devise'
gem 'nifty-generators'
gem 'mocha'
gem 'thin'
gem 'omniauth'
require 'oauth2'
gem 'fb_graph'
gem 'nokogiri'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'

group :development do
gem 'rspec-rails', '2.5.0'

gem 'faker', '0.9.5'
end 

group :test do
gem 'rspec', '2.5.0'
gem 'webrat', '0.7.1' 
gem 'spork', '0.9.0.rc5'
gem 'factory_girl_rails', '1.0'
end

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'

# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫嚣ゝ 2025-01-02 19:49:42

您可以尝试在项目根目录中添加包含以下内容的 .rvmrc:

rvm ruby​​-1.9.3-head@your-project-name

之后,重新启动控制台会话。 RVM 将请求使用该文件的权限。之后,您的项目将在它自己的 gemspace 下运行。再次运行bundle,它将仅安装所需的gems。

You can try adding an .rvmrc in your project root with this content:

rvm ruby-1.9.3-head@your-project-name

After that, restart your console session. RVM will ask for permission to use the file. After that, your project will run under it's own gemspace. Run bundle again, and it will install only the required gems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文