Why does `gem install` succeed but `bundle install` fails? - ruby

I'm trying to install gtk3, but bundle install chokes while installing atk. Most of the responses seem to resolve around mismatched versions in the lock file. Removing the lock file doesn't help, neither does installing the matching version of bundle.
$ bundle install
Fetching gem metadata from https://rubygems.org/....
Resolving dependencies...
Using bundler 2.4.6
Fetching native-package-installer 1.1.5
Fetching pkg-config 1.5.1
Installing pkg-config 1.5.1
Installing native-package-installer 1.1.5
Fetching glib2 3.5.1
Installing glib2 3.5.1 with native extensions
Fetching atk 3.5.1
Installing atk 3.5.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/sproctor/code/lich-5/vendor/bundle/ruby/2.7.0/gems/atk-3.5.1/dependency-check
rake RUBYARCHDIR\=/home/sproctor/code/lich-5/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/atk-3.5.1
RUBYLIBDIR\=/home/sproctor/code/lich-5/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/atk-3.5.1
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem
rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
from /home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems.rb:282:in `activate_bin_path'
from /home/sproctor/.rvm/gems/ruby-2.7.7/bin/rake:23:in `<main>'
from /home/sproctor/.rvm/gems/ruby-2.7.7/bin/ruby_executable_hooks:22:in `eval'
from /home/sproctor/.rvm/gems/ruby-2.7.7/bin/ruby_executable_hooks:22:in `<main>'
rake failed, exit code 1
Gem files will remain installed in /home/sproctor/code/lich-5/vendor/bundle/ruby/2.7.0/gems/atk-3.5.1 for inspection.
Results logged to
/home/sproctor/code/lich-5/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/atk-3.5.1/gem_make.out
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:102:in `run'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/rake_builder.rb:28:in `build'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:170:in `build_extension'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:204:in `block in
build_extensions'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:201:in `each'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:201:in `build_extensions'
/home/sproctor/.rvm/rubies/ruby-2.7.7/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:843:in `build_extensions'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/rubygems_gem_installer.rb:72:in `build_extensions'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/rubygems_gem_installer.rb:28:in `install'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/source/rubygems.rb:200:in `install'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/installer/gem_installer.rb:54:in `install'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/installer/parallel_installer.rb:155:in
`do_install'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/installer/parallel_installer.rb:146:in `block in
worker_pool'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/worker.rb:62:in `apply_func'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/worker.rb:57:in `block in process_queue'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/worker.rb:54:in `loop'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/worker.rb:54:in `process_queue'
/home/sproctor/.rvm/gems/ruby-2.7.7/gems/bundler-2.4.6/lib/bundler/worker.rb:90:in `block (2 levels) in
create_threads'
An error occurred while installing atk (3.5.1), and Bundler cannot continue.
In Gemfile:
atk
However, installing via gem works fine.
gem install atk -v 3.5.1
Building native extensions. This could take a while...
Successfully installed atk-3.5.1
Parsing documentation for atk-3.5.1
Done installing documentation for atk after 0 seconds
1 gem installed

This isn't a great answer, so if someone has a more in depth explanation, please feel free to give a better answer.
gem install gtk3 and bundle install use a different copy of rake.
The only difference between the two is the shebang line. The version from bundler is #!/usr/bin/env ruby_executable_hooks while the other version points to a specific version of ruby.
I'm not sure why this fails for the bundler version.
An easy workaround mentioned here: https://github.com/postmodern/digest-crc/issues/18#issuecomment-652889761 is to add gem "rake" to your Gemfile.

Related

error while run npm run dev after adding extension for App Lock theme in shopify app MERN

━━━━━━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Command failed with exit code 1: bundle install
Your lockfile was created by an old Bundler that left some things out.
Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing 4 at a time.
You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile.
The missing gems are:
* mini_portile2 depended upon by nokogiri
--- ERROR REPORT TEMPLATE -------------------------------------------------------
```
NoMethodError: undefined method `full_name' for nil:NilClass
warning << "* #{unmet_spec_dependency}, depended upon #{spec.full_name}, unsatisfied by #{#specs.find {|s| s.name == unmet_spec_dependency.name && !unmet_spec_dependency.matches_spec?(s.spec) }.full_name}"
^^^^^^^^^^
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:124:in `block (2 levels) in check_for_unmet_dependencies'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:123:in `each'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:123:in `block in check_for_unmet_dependencies'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:122:in `each'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:122:in `check_for_unmet_dependencies'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:100:in `call'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer/parallel_installer.rb:71:in `call'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer.rb:254:in `install_in_parallel'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer.rb:209:in `install'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer.rb:89:in `block in run'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/process_lock.rb:12:in `block in lock'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/process_lock.rb:9:in `open'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/process_lock.rb:9:in `lock'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer.rb:71:in `run'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/installer.rb:23:in `install'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/cli/install.rb:62:in `run'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:257:in `block in install'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/settings.rb:131:in `temporary'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:256:in `install'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:25:in `start'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/exe/bundle:48:in `block in <top (required)>'
C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/exe/bundle:36:in `<top (required)>'
C:/Ruby31-x64/bin/bundle:33:in `load'
C:/Ruby31-x64/bin/bundle:33:in `<main>'
```
## Environment
```
Bundler 2.3.23
Platforms ruby, x64-mingw-ucrt
Ruby 3.1.2p20 (2022-04-12 revision 4491bb740a9506d76391ac44bb2fe6e483fec952) [x64-mingw-ucrt]
Full Path C:/Ruby31-x64/bin/ruby.exe
Config Dir C:/ProgramData
RubyGems 3.3.23
Gem Home C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/ruby/3.1.0
Gem Path C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/ruby/3.1.0
User Home C:/Users/reeba
User Path C:/Users/reeba/.local/share/gem/ruby/3.1.0
Bin Dir C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/ruby/3.1.0/bin
OpenSSL
Compiled OpenSSL 1.1.1n 15 Mar 2022
Loaded OpenSSL 1.1.1n 15 Mar 2022
Cert File C:/Ruby31-x64/ssl/cert.pem
Cert Dir C:/Ruby31-x64/ssl/certs
Tools
Git 2.32.0.windows.2
RVM not installed
rbenv not installed
chruby not installed
```
## Bundler Build Metadata
```
Built At 2022-10-05
Git SHA 250d9d485d
Released Version true
```
## Bundler settings
```
path
Set for your local app (C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/.bundle/config): "C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0"
```
## Gemfile
### Gemfile
```ruby
source 'https://rubygems.org'
gem 'shopify-cli', '2.25.0'
```
### Gemfile.lock
```
<No C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/Gemfile.lock found>
```
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/rubygems/rubygems/search?q=undefined+method+%60full_name%27+for+nil+NilClass&type=Issues
If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there.
Fetching gem metadata from https://rubygems.org/.............
Resolving dependencies...
Using ast 2.4.2
Using concurrent-ruby 1.1.10
Using bugsnag 6.24.2
Using bundler 2.3.23
Using ffi 1.15.5
Using liquid 5.4.0
Using rb-fsevent 0.11.2
Using rb-inotify 0.10.1
Using listen 3.7.1
Using racc 1.6.0
Installing nokogiri 1.13.8 with native extensions
I've got the same error message.
First of all I've made the gem update and the bundler updates:
gem install bundler
gem update --system
And then:
You should find the Gemfile.lock file in the directory .../path to your installed folder/lib/ruby/gems/2.7.0/gems/shopify-cli-2.27.0/Gemfile.lock and copy in to the folder C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/
Generally it says - that the Gemfile.lock is not found:
Gemfile.lock
<No C:/Users/reeba/AppData/Local/shopify-cli-nodejs/Cache/vendor/ruby-cli/2.25.0/Gemfile.lock found>
That should help.
I had the same problem and this worked for me:
If you are using shopify cli 3.0+ and ruby 3.1.2 then copy Gemfile.lock from => *ruby path installed folder */lib/ruby/gems/2.7.0/gems/shopify-app/Gemfile.lock
OR in other versions it will be in *ruby path installed folder */lib/ruby/gems/2.7.0/gems/shopify-cli-2.27.0/Gemfile.lock
Add the Gemfile.lock in C:\Users\reeba\AppData\Local\shopify-cli-nodejs\Cache\vendor\ruby-cli\2.27.0
And also add same file at C:\Users\reeba\AppData\Local\shopify-cli-nodejs\Cache\vendor\theme-check\1.10.3

Failing to install ruby-debug-ide gem under ruby 2.1.2

I am trying to install the ruby-debug-ide gem under ruby 2.1.2 . This to debug in Rubymine.
It worked for ruby1.9.3 but not for this version.
here is the error:
1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/***internal.h:209: error: expected ‘;’, ‘,’ or ‘)’ before ‘x’***
Here is the output.
I would love the ability to make sence or debug this in some way . A quick fix will also be great by the way :-)
Fetching: ruby-debug-ide-0.4.22.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
/Users/ohad/.rvm/rubies/ruby-2.1.2/bin/ruby mkrf_conf.rb
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
/Users/ohad/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling breakpoint.c
compiling context.c
compiling debase_internals.c
In file included from /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/method.h:14,
from /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/vm_core.h:24,
from ./hacks.h:1,
from debase_internals.c:2:
/Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/***internal.h:209: error: expected ‘;’, ‘,’ or ‘)’ before ‘x’***
make: *** [debase_internals.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/gems/debase-0.0.9 for inspection.
Results logged to /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/extensions/x86_64-darwin-13/2.1.0-static/debase-0.0.9/gem_make.out
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:51:in `block in make'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:43:in `each'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:43:in `make'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tempfile.rb:324:in `open'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/installer.rb:677:in `build_extensions'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/installer.rb:232:in `install'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:142:in `block in install'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:126:in `each'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:126:in `install'
/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/dependency_installer.rb:389:in `install'
mkrf_conf.rb:34:in `rescue in <main>'
mkrf_conf.rb:27:in `<main>'
rake failed, exit code 1
Gem files will remain installed in /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/gems/ruby-debug-ide-0.4.22 for inspection.
Results logged to /Users/ohad/.rvm/gems/ruby-2.1.2#v1_v2/extensions/x86_64-darwin-13/2.1.0-static/ruby-debug-ide-0.4.22/gem_make.out
Also, I failed to install with ruby rvm reinstall ruby-2.1.2 --disable-binary with this error
`dyld: Library not loaded: ##HOMEBREW_CELLAR##/openssl/1.0.1i/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/openssl/bin/openssl
Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return code: ().
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm,, for more information.
Requirements installation failed with status: 133.`
The problem seems to be that the gem debugger-ruby_core_source can’t find the header file vm_core.h, which is part of Ruby’s source code. To install the source only (given that you have the binaries installed already) do:
$ rvm fetch ruby-2.1.2
You can also reinstall from source (a bit slower but it’s a good habit):
$ rvm reinstall ruby-2.1.2 --disable-binary
Update based on your additional error message
According to your message, you need to install OpenSSL:
$ brew install openssl
To sum up:
You can’t install debugger-ruby_core_source because it needs the
Ruby source for your Ruby version.
You can’t install the Ruby source
code with RVM because the Open SSL libraries are missing.
To remedy that type rvm autolibs homebrew so that RVM will install the missing packages if needed (you might need root permissions and enter your password when requested). This also lets RVM takes care of dependency problems from now on, you shouldn’t need to type the command again.
I had a similar issue, and installing the debugger-ruby_core_source gem manually before installing ruby-debug-ide worked.
I had this happen to me today, and solved it after running brew unlink openssl && brew link openssl --force
Hope it helps.

`bundler install --deployment` missing `to_yaml`?

I am not a ruby expert, but I have managed to gather enough information to setup a Gemfile and install required Gemfiles.
Lately, however, I've had some problems. For whatever reason, I am now getting this error:
> bundle install --deployment
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `set_key': undefined method `to_yaml' for {"BUNDLE_FROZEN"=>"1"}:Hash (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `open'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:129:in `set_key'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/settings.rb:17:in `[]='
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/cli.rb:219:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/task.rb:27:in `__send__'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/task.rb:27:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/vendor/thor/base.rb:434:in `start'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/bin/bundle:20
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.3.1/bin/bundle:20
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
I have taken a look at the recommended link, but the problem remains. My Gemfile is quite simple:
source "https://rubygems.org"
gem 'sass'
And the accompanying Gemfile.lock:
GEM
remote: https://rubygems.org/
specs:
sass (3.2.6)
PLATFORMS
ruby
DEPENDENCIES
sass
Why is bundler failing to install?
Further details:
Using an older version of bundler (say, 1.2), works just fine. Just not 1.3.1
I am using ruby 1.8.7, and rubygems 1.8.11.
Just had the same issue and solved it by uninstalling the latest bundler version 1.3.1
gem uninstall bundler -v 1.3.1
bundler 1.3.0 should make it pass ;)
edit: no idea why though :|
Any chance the when you installed ruby you didn't have libyaml installed on the system. Ruby requires libyaml for it's standardlib yaml library to function.
Try installing libyaml (look up how to for your particular OS) and then re-installing ruby.

1.9.3 installed, error message factory_girl requires Ruby version >= 1.9.2

I just installed rbenv with ruby 1.9.3
rbenv version
1.9.3-p327 (set by /Users/me/.rbenv/version)
However, when I tried to run bundle update (inside a project that was created before rbenv was installed), I got an error message that factory_girl required at least ruby 1.9.2. See error message below
If it's relevant, when I do gem --version, I see a reference to 1.8.23.
gem --version
1.8.23
Error message
Installing factory_girl (4.1.0) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:163:in `install': factory_girl requires Ruby version >= 1.9.2. (Gem::InstallError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:268:in `update'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
Update:
The first answer told me to do three steps
gem install bundle
rbenv rehash
bundle install
I did those steps (it installed bundler) '
gem install bundler
Fetching: bundler-1.2.3.gem (100%)
Successfully installed bundler-1.2.3
1 gem installed
but when I tried 'bundle install, I got the same error message about Factory_girl. Interestingly, I decided to try those three steps again, beginning with gem install bunlder, and it installed it again?!#??
The bundle command you are using is from system Ruby installation which is Ruby 1.8.x.
Try
gem install bundler
rbenv rehash
bundle install
This should solve your problem.

Exclude hoe gem dependency from Heroku

I am trying to push code to Heroku and it seems like the system gem "hoe" is somehow included by some other gem (geokit was one of them but no luck even after removing that gem from Gemfile). This is causing Heroku to fail because it cannot update system gems. how to solve this issue?
Installing geokit (1.5.0)
Installing geonames (0.2.2)
Installing hoe (2.9.1) /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:170:in `install': hoe requires RubyGems version >= 1.4. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError)
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
from /usr/ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
Just pin it in your Gemfile, I bet your dependent gems don't depend on 2.9.1. Add this:
gem 'hoe', '~> 1.5.1' # Heroku's rubygems is too old for hoe 2.9.1 as of 28 Mar 2011

Resources