启动应用程序Bundler :: GemNotFound时出错

时间:2012-06-30 11:13:28

标签: ruby-on-rails gem bundler rack rack-pow

我刚刚启动了一个新的应用,但是当我点击欢迎登陆页面上的“关于你的应用程序的环境”链接时出现此错误。

  

启动应用程序时出错您的Rack应用程序在Pow时引发异常   试图运行它。

     

Bundler :: GemNotFound:在任何一个中都找不到activesupport-3.2.6   来源

我的应用正在运行:

  • Rails 3.2.6
  • Ruby 1.9.3p194
  • Rubygems 1.8.24
  • RVM 1.14.5
  • 战俘0.4.0

我发现了类似的问题,问题是如何解决乘客问题,但我没有使用它。

当我运行gem list时,我得到:

  

*本地宝石*

     

actionmailer(3.2.6)actionpack(3.2.6)activemodel(3.2.6)   activerecord(3.2.6)activeresource(3.2.6)activesupport(3.2.6)arel   (3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(3.2.2)   coffee-script(2.2.0)coffee-script-source(1.3.3)daemon_controller   (1.0.0)erubis(2.7.0)execjs(1.4.0)fastthread(1.0.7)加息(1.2.1)   i18n(0.6.0)征途(1.0.4)jquery-rails(2.0.2)json(1.7.3)邮件   (2.4.4)mime-types(1.19)multi_json(1.3.6)乘客(3.0.13)   polyglot(0.3.3)rack(1.4.1)rack-cache(1.2)rack-ssl(1.3.2)   rack-test(0.6.1)rail(3.2.6)railties(3.2.6)rake(0.9.2.2)rdoc   (3.12)rubygems-bundler(1.0.3)rvm(1.11.3.4)sass(3.1.20)   sass-rails(3.2.5)链轮(2.4.3,2.1.3)sqlite3(1.3.6)thor   (0.15.4,0.15.3)倾斜(1.3.3)树梢(1.4.10)tzinfo(0.3.33)   uglifier(1.2.6)

非常感谢任何帮助,谢谢。

更新

source 'https://rubygems.org'

gem 'rails', '3.2.6'

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

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

Gemfile.lock的

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.6)
      actionpack (= 3.2.6)
      mail (~> 2.4.4)
    actionpack (3.2.6)
      activemodel (= 3.2.6)
      activesupport (= 3.2.6)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.1)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.3)
    activemodel (3.2.6)
      activesupport (= 3.2.6)
      builder (~> 3.0.0)
    activerecord (3.2.6)
      activemodel (= 3.2.6)
      activesupport (= 3.2.6)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.6)
      activemodel (= 3.2.6)
      activesupport (= 3.2.6)
    activesupport (3.2.6)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    arel (3.0.2)
    builder (3.0.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.3.3)
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.0)
    journey (1.0.4)
    jquery-rails (2.0.2)
      railties (>= 3.2.0, < 5.0)
      thor (~> 0.14)
    json (1.7.3)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.19)
    multi_json (1.3.6)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.2.6)
      actionmailer (= 3.2.6)
      actionpack (= 3.2.6)
      activerecord (= 3.2.6)
      activeresource (= 3.2.6)
      activesupport (= 3.2.6)
      bundler (~> 1.0)
      railties (= 3.2.6)
    railties (3.2.6)
      actionpack (= 3.2.6)
      activesupport (= 3.2.6)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (0.9.2.2)
    rdoc (3.12)
      json (~> 1.4)
    sass (3.1.20)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sprockets (2.1.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.6)
    thor (0.15.4)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.33)
    uglifier (1.2.6)
      execjs (>= 0.3.0)
      multi_json (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 3.2.1)
  jquery-rails
  rails (= 3.2.6)
  sass-rails (~> 3.2.3)
  sqlite3
  uglifier (>= 1.0.3)

我已经运行了bundle install,它已经完成了。但是,如果我运行sudo bundle install,我会得到:

/Users/dave/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
    from /Users/dave/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /Users/dave/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /Users/dave/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle:18:in `<main>'
    from /Users/dave/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/dave/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

2 个答案:

答案 0 :(得分:6)

Pow可能正试图用“bundle exec”前缀启动你的应用程序。这意味着您的应用只会看到Gemfile中的gem(更准确地说,只会看到当前环境组中的gem)。

这很棒,因为它可以让您在不同版本中使用相同的gem拥有多个应用程序:您可能有一个使用Rails 2的应用程序和另一个使用Rails 3的应用程序,两者都安装在您的系统上,但您的第一个应用程序说它依赖在其Gemfile中的Rails 2上,另一个将Rails 3指定为依赖项。

长话短说:您必须在Gemfile中声明每个依赖项并在访问应用程序之前运行“bundle install”。

还有一条建议:不要忘记指定rake的版本,甚至是你使用的捆绑包,这可能会在你的开发系统上升级那些宝石时节省你的生命,但不会在你的prod服务器上升级

答案 1 :(得分:1)

我得到了同样的错误:通过以下命令解决:

rvm use ruby-version

gem install rails