2

Environment:

  • Mac OS X 10.11.3 (El Capitan)
  • Homebrew 0.9.5
  • rvm 1.26.11 (same problem occurs with rbenv)
  • Bundler 1.11.2

Gemfile (excerpt):

source 'https://rubygems.org'
require 'bundler/bower'

asset "jquery", "~2.1.4"`

I get this error:

bundle install

[!] There was an error parsing `Gemfile`:
cannot load such file -- bundler/bower. Bundler cannot continue.

 #  from /Users/nobby/becompany/website/src/website-static/Gemfile:5
 #  -------------------------------------------
 #  
 >  require 'bundler/bower'
 #  
 #  -------------------------------------------

My RubyGems environment is:

- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/nobby/.rvm/gems/ruby-2.3.0
- USER INSTALLATION DIRECTORY: /Users/nobby/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /Users/nobby/.rvm/rubies/ruby-2.3.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/nobby/.rvm/gems/ruby-2.3.0/bin
- SPEC CACHE DIRECTORY: /Users/nobby/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/nobby/.rvm/rubies/ruby-2.3.0/etc
- RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
- GEM PATHS:
    - /Users/nobby/.rvm/gems/ruby-2.3.0
    - /Users/nobby/.rvm/gems/ruby-2.3.0@global
- GEM CONFIGURATION:
    - :update_sources => true
    - :verbose => true
    - :backtrace => false
    - :bulk_threshold => 1000
- REMOTE SOURCES:
    - https://rubygems.org/
- SHELL PATH:
    - /Users/nobby/.rvm/gems/ruby-2.3.0/bin
    - /Users/nobby/.rvm/gems/ruby-2.3.0@global/bin
    - /Users/nobby/.rvm/rubies/ruby-2.3.0/bin
    - /Users/nobby/.rvm/bin
    - /Users/nobby/src/apache/ant/apache-ant-1.9.6/bin
    - /usr/local/bin
    - /usr/bin
    - /bin
    - /usr/sbin
    - /sbin

Maybe bundler is looking in the wrong gem paths? Is there a way to see which paths it is using?


It works when I manually add the dependencies to LOAD_PATH in Gemfile; maybe this helps to point me to the cause of the problem:

[ 'bundler-bower-0.0.3', 'bower-rails-0.10.0'].each do |dep|
  $LOAD_PATH.unshift "/Users/nobby/.rvm/gems/ruby-2.3.0/gems/#{dep}/lib"
end
devkat
  • 1,624
  • 14
  • 15

1 Answers1

-1

https://github.com/LTe/bundler-bower

You need to

gem install 'bundler-bower'

before you can require modules from it. Potentially (hopefully) bundler is clever enough to resolve dependency order if you add

gem 'bundler-bower'

to your gemfile and then install it with bundle install instead

Tim Spence
  • 67
  • 7
  • Hi Tim, thanks a lot for your reply. I had already run `gem install 'bundler-bower'` successfully. Adding `gem 'bundler-bower'` unfortunately doesn't seem to help, I still get the same error. – devkat Mar 23 '16 at 16:54