Using Bundler, RVM and RubyGems - ruby

I seem to be getting an odd issue here, not sure where to look to debug it. I have had Ruby installed on my machine for a while now but today have added RVM. So I will run through the steps I am taking:
My Gemfile:
source 'https://rubygems.org'
gem 'capistrano', '~> 3.1.0'
Try to install:
$ bundle
Fetching gem metadata from https://rubygems.org/.......
Installing rake (10.2.1)
Gem::InstallError: rake requires Ruby version >= 1.9.
An error occured while installing rake (10.2.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.2.1'` succeeds before bundling.
Check Ruby version, which is greater than 1.9:
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
Make sure rake is installed:
$ gem list
*** LOCAL GEMS ***
...
rake (10.2.1)
...
Try installing rake anyway:
$ sudo gem install rake -v '10.2.1'
Successfully installed rake-10.2.1
Parsing documentation for rake-10.2.1
1 gem installed
Make sure rake is installed:
$ gem list
*** LOCAL GEMS ***
...
rake (10.2.1)
...
Try again:
$ bundle
Fetching gem metadata from https://rubygems.org/.......
Installing rake (10.2.1)
Gem::InstallError: rake requires Ruby version >= 1.9.
An error occured while installing rake (10.2.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.2.1'` succeeds before bundling.
Perhaps some useful information:
$ rvm info
system:
system:
uname: "Darwin ians-MacBook-Pro.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
version: "rvm 1.25.22 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "3 hours 34 minutes 31 seconds ago"
path: "/Users/ianjamieson/.rvm"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Applications/android-developer-tools/sdk/platform-tools:/Applications/android-developer-tools/sdk/tools:/usr/lib/apache-ant-1.9.2/bin:/usr/local/mysql/bin:/Applications/android-developer-tools/sdk/platform-tools:/Applications/android-developer-tools/sdk/tools::/usr/lib/apache-ant-1.9.2/bin:/usr/local/mysql/bin:/Users/ianjamieson/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
Thanks.

The fix for me was:
$ rvm reinstall 2.1.1
It seems as though, when I installed this version the first time round it didn't complete correctly and didn't update all the paths. So gem install was installing my gems in the wrong place.

Related

Unable to install bundler with gem

I am using ruby 2.6.5 and I try to install bundler -v 2.2.27 gem according to documentation using this command:
gem install bundler -v 2.2.27 --default
And this is the output I get:
gem install bundler -v 2.2.27 --default
Successfully installed bundler-2.2.27 as a default gem
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory # dir_chdir - /Users/jedrek/.rvm/gems/ruby-2.6.5/specifications/gems/bundler-2.2.27
It says it installed the gem but errors out at the same time :)
When I check current version of bundler I get this output
gem info bundler
*** LOCAL GEMS ***
bundler (2.2.32, 2.2.27, 2.2.24, 2.1.4)
Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
Terence Lee, Carl Lerche, Yehuda Katz
Homepage: https://bundler.io
License: MIT
Installed at (2.2.32): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.2.27, default): /Users/jedrek/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
(2.2.24): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.1.4): /Users/jedrek/.rvm/gems/ruby-2.6.5
As you can see it says that bundler -v 2.2.27 is installed.
When I try to install dependencies in my project I get this error:
bundle install
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 2.2.27)
Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 2.2.27)' in any of the relevant sources:
the local ruby installation
Listing current bundler version locally shows this output
gem list bundler
*** LOCAL GEMS ***
bundler (2.2.32, default: 2.2.27, 2.2.24, 2.1.4)
bundler-audit (0.7.0.1, 0.6.1)
capistrano-bundler (2.0.1, 1.3.0)
I am so confused. Is this is a bug?
I am using rubygems 3.2.27
gem --version
3.2.27
UPDATE
I tried upgrading rubygems to 3.2.32 and have the same issue.

gem install fails in RVM, El Capitan 10.11

Is this because of the empty GEM_HOME variable on Environment?
I couldn't figure it out for hours..
➜ ~ gem install mysql
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory -
➜ ~ mysql --version
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper
➜ ~ gem install mysql2
Fetching: mysql2-0.4.2.gem (100%)
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory -
➜ ~ rvm info
system:
system:
uname: "Darwin Seos-MacBook.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64"
system: "osx/10.11/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)"
zsh: "/bin/zsh => zsh 5.0.8 (x86_64-apple-darwin15.0)"
rvm:
version: "rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "21 minutes 30 seconds ago"
path: "/Users/seoyoochan/.rvm"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/Users/seoyoochan/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
➜ ~
Thanks for the comments guys, I just fixed it myself.
When i checked the version of gem, it was very old (probably 2.0.4)
trying to do gem update --system was also failed, so i added sudo.
sudo gem update --system did solve the issue.

RVM breaks gems, looking in wrong Ruby version

I have ruby 2.2.0 and I use RVM for a project that requires 2.0.0
After installing RVM I tried to use sass or compass gems outside the project and got this:
$ compass watch
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/compass:22:in `<main>'
I tried removing RVM and reinstalling the gems and all worked fine, but I need it for the project.
Why is it looking in 2.0 folder? When I do rvm info I get ruby-2.2.0:
Update:
$ which ruby
/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby
$ which compass
/usr/bin/compass
$rvm info
ruby-2.2.0:
system:
uname: "Darwin ilyo-audyx.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
zsh: "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
rvm:
version: "rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "4 days 7 hours 57 minutes 33 seconds ago"
path: "/Users/ilyo/.rvm"
ruby:
interpreter: "ruby"
version: "2.2.0p0"
date: "2014-12-25"
platform: "x86_64-darwin14"
patchlevel: "2014-12-25 revision 49005"
full_version: "ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]"
homes:
gem: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
binaries:
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby"
irb: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/irb"
gem: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/gem"
rake: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/rake"
environment:
PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0/bin:/Users/ilyo/.rvm/gems/ruby-2.2.0#global/bin:/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin:/Users/ilyo/.rvm/bin:/usr/local/bin:/Users/ilyo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
GEM_HOME: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
GEM_PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0:/Users/ilyo/.rvm/gems/ruby-2.2.0#global"
MY_RUBY_HOME: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
IRBRC: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/.irbrc"
RUBYOPT: ""
gemset: ""

rvm install 2.1.4 <--- fails on Mac OS X mavricks

Trying to install ruby 2.1.4 using latest rvm on Mac OS X Mavericks...
rvm fails to install ruby 2.1.4
Cryptic error message about empty default gemset ??
Tried installing twice.
I was able to install ruby 2.1.3 few days ago, and all was okay
Help appreciated
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ rvm info
ruby-2.1.3#rspec-2:
system:
uname: "Darwin hani-elabeds-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
version: "rvm 1.26.0 (latest) by Wayne E. Seguin , Michal Papis [https://rvm.io/]"
updated: "21 minutes 6 seconds ago"
path: "/Users/helabed/.rvm"
ruby:
interpreter: "ruby"
version: "2.1.3p242"
date: "2014-09-19"
platform: "x86_64-darwin14.0"
patchlevel: "2014-09-19 revision 47630"
full_version: "ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]"
homes:
gem: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2"
ruby: "/Users/helabed/.rvm/rubies/ruby-2.1.3"
binaries:
ruby: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/ruby"
irb: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/irb"
gem: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/gem"
rake: "/Users/helabed/.rvm/rubies/ruby-2.1.3/bin/rake"
environment:
PATH: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2/bin:/Users/helabed/.rvm/gems/ruby-2.1.3#global/bin:/Users/helabed/.rvm/rubies/ruby-2.1.3/bin:/Users/helabed/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/helabed/bin:/usr/local/mysql/bin:/Users/helabed/Android/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:/Users/helabed/Android/adt-bundle-mac-x86_64-20140321/sdk/tools/"
GEM_HOME: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2"
GEM_PATH: "/Users/helabed/.rvm/gems/ruby-2.1.3#rspec-2:/Users/helabed/.rvm/gems/ruby-2.1.3#global"
MY_RUBY_HOME: "/Users/helabed/.rvm/rubies/ruby-2.1.3"
IRBRC: "/Users/helabed/.rvm/rubies/ruby-2.1.3/.irbrc"
RUBYOPT: ""
gemset: "rspec-2"
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.4)
bundler (1.7.4)
bundler-unload (1.0.2)
diff-lcs (1.2.5)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.5)
rake (10.1.0)
rdoc (4.1.0)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
test-unit (2.1.3.0)
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $ rvm reinstall 2.1.4
ruby-2.1.4 - #removing rubies/ruby-2.1.4..
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.1.4 - #configure
ruby-2.1.4 - #download
ruby-2.1.4 - #validate archive
ruby-2.1.4 - #extract
ruby-2.1.4 - #validate binary
ruby-2.1.4 - #setup
ruby-2.1.4 - #gemset created /Users/helabed/.rvm/gems/ruby-2.1.4#global
ruby-2.1.4 - #importing gemset /Users/helabed/.rvm/gemsets/global.gems........................................................................
ruby-2.1.4 - #generating global wrappers..............
ruby-2.1.4 - #gemset created /Users/helabed/.rvm/gems/ruby-2.1.4
ruby-2.1.4 - #importing gemsetfile /Users/helabed/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.4 - #generating default wrappers..............
/Users/helabed/.rvm/scripts/functions/support: line 490: 17899 Trace/BPT trap: 5 "$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"#{value.gsub("$","\\$")}\"\n")
}
}
' > /dev/null 2>&1
Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main
Making gemset ruby-2.1.4 pristine................................................................
Making gemset ruby-2.1.4#global pristine.................................................................
helabed#hani-elabeds-MacBook-Pro:~/rails-proj $
I had a similar problem with 2.1.4, rvm reinstall 2.1.4 --disable-binary worked for me. thanks to #csage for the pointer.
similar issue here
Error when installing Ruby 2.1.3 with RVM
I ran into similar issues where 2.1.3 and 2.1.4 hang on the compilation step.
This solved my issue:
rvm install 2.1.4 -- --with-setjmp-type=setjmp
original source of fix

issues with gem path with travis ci and ruby 1.8.7

I am using travis for the first time and am trying to understand why my bundle installed gems are not available with ruby 1.8.7
Gemfile
source 'https://rubygems.org'
gem 'rspec'
.travis.yml
language: ruby
script: bundle exec rspec
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
travis output
$ rvm use 1.8.7 --install --binary --fuzzy
Using /home/travis/.rvm/gems/ree-1.8.7-2012.02
$ export BUNDLE_GEMFILE=$PWD/Gemfile
$ ruby --version
ruby 1.8.7 (2013-06-27 MBARI 8/0x6770 on patchlevel 374) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02
$ rvm --version
rvm 1.25.20 (version) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
$ gem --version
2.0.14
$ bundle --version
Bundler version 1.6.1
$ bundle install --deployment
Fetching gem metadata from https://rubygems.org/...
Fetching additional metadata from https://rubygems.org/..
Installing diff-lcs 1.2.5
Installing rspec-core 2.14.8
Installing rspec-expectations 2.14.5
Installing rspec-mocks 2.14.6
Installing rspec 2.14.1
Using bundler 1.6.1
Your bundle is complete!
It was installed into ./vendor/bundle
$ bundle exec rspec
Could not find diff-lcs-1.2.5 in any of the sources
Run `bundle install` to install missing gems.
Based on other references, the suggested .yml file would be:
language: ruby
script: "bundle exec rspec"
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
Refer to: https://coderwall.com/p/x8exja
Looks like a bug in Travis-ci: https://github.com/travis-ci/travis-ci/issues/2253
There appears to be a workaround, but it haven't tried it.

Resources