Ruby - 无法加载捆绑器

时间:2012-03-23 09:50:31

标签: ruby bundler

我用rvm gem install bundler安装了bundler。这里有什么问题?

还使用这些选项重新安装 -

apt-get install libncurses5-dev libreadline5-dev libreadline-dev librequire-dev
rvm use ruby-1.9.3-p125 --default
rvm reinstall librequire-dev libbundler-dev --with-readline-dir=/usr/include/readline



       $ rails new proj

           exist
       identical  README.rdoc
       identical  Rakefile
       identical  config.ru
       identical  .gitignore
       identical  Gemfile
           exist  app
       identical  app/assets/images/rails.png
       identical  app/assets/javascripts/application.js
       identical  app/assets/stylesheets/application.css
       identical  app/controllers/application_controller.rb
       identical  app/helpers/application_helper.rb
           exist  app/mailers
           exist  app/models
       identical  app/views/layouts/application.html.erb
       identical  app/mailers/.gitkeep
       identical  app/models/.gitkeep
           exist  config
       identical  config/routes.rb
       identical  config/application.rb
       identical  config/environment.rb
           exist  config/environments
       identical  config/environments/development.rb
       identical  config/environments/production.rb
       identical  config/environments/test.rb
           exist  config/initializers
       identical  config/initializers/backtrace_silencers.rb
       identical  config/initializers/inflections.rb
       identical  config/initializers/mime_types.rb
        conflict  config/initializers/secret_token.rb
    Overwrite /root/src/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] y
           force  config/initializers/secret_token.rb
       identical  config/initializers/session_store.rb
       identical  config/initializers/wrap_parameters.rb
           exist  config/locales
       identical  config/locales/en.yml
       identical  config/boot.rb
       identical  config/database.yml
           exist  db
       identical  db/seeds.rb
           exist  doc
       identical  doc/README_FOR_APP
           exist  lib
           exist  lib/tasks
       identical  lib/tasks/.gitkeep
           exist  lib/assets
       identical  lib/assets/.gitkeep
           exist  log
       identical  log/.gitkeep
           exist  public
       identical  public/404.html
       identical  public/422.html
       identical  public/500.html
       identical  public/favicon.ico
       identical  public/index.html
       identical  public/robots.txt
           exist  script
       identical  script/rails
           exist  test/fixtures
       identical  test/fixtures/.gitkeep
           exist  test/functional
       identical  test/functional/.gitkeep
           exist  test/integration
       identical  test/integration/.gitkeep
           exist  test/unit
       identical  test/unit/.gitkeep
       identical  test/performance/browsing_test.rb
       identical  test/test_helper.rb
           exist  tmp/cache
           exist  tmp/cache/assets
           exist  vendor/assets/javascripts
       identical  vendor/assets/javascripts/.gitkeep
           exist  vendor/assets/stylesheets
       identical  vendor/assets/stylesheets/.gitkeep
           exist  vendor/plugins
       identical  vendor/plugins/.gitkeep
             run  bundle install
    /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler (LoadError)
            from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
            from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.2/bin/bundle:2:in `<main>'

3 个答案:

答案 0 :(得分:5)

安装RVM后我做的第一件事就是安装捆绑到全球宝石集。

rvm use 1.9.3@global
gem install bundler
rvm use 1.9.3

当你将gem安装到全局gemset时,它将在同一个ruby中的所有gemsets(包括默认值)中可用。

答案 1 :(得分:2)

仅仅gem install bundler呢?

答案 2 :(得分:1)

我用过

sudo gem install bundler

然后我能够在没有错误的情况下继续进行并运行我的rspec测试

$ rspec near_time_in_words.rb 
.....

Finished in 0.00171 seconds
5 examples, 0 failures

:)