机架依赖性阻止瘦启动

时间:2012-01-12 02:21:53

标签: ruby ruby-on-rails-3 rack thin webrick

    .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)

当我尝试在我的任何应用上运行瘦启动,捆绑exec瘦,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

1 个答案:

答案 0 :(得分:1)

您可以尝试使用以下内容在项目根目录中添加.rvmrc:

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

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