xaphod xaphod - 1 year ago 56
Ruby Question

Why isn't gem found? Ruby + RVM + bundler on Mac w/ El Capitan

Why can't it find nest_thermostat?

Tim-rMBP:Nested Tim$ cat Gemfile
# frozen_string_literal: true
# A sample Gemfile
source "https://rubygems.org"

gem "oauth2"
gem "json"
gem "nest_thermostat", :git => 'https://github.com/ericboehs/nest_thermostat.git'

Tim-rMBP:Nested Tim$ bundle install

Fetching https://github.com/ericboehs/nest_thermostat.git
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Installing multipart-post 2.0.0
Installing multi_json 1.12.1
Installing multi_xml 0.5.5
Using json 1.8.3
Installing jwt 1.5.1
Installing rack 1.6.4
Using bundler 1.12.5
Installing faraday 0.9.2
Installing httparty 0.8.3
Installing oauth2 1.1.0
Using nest_thermostat 0.0.5 from https://github.com/ericboehs/nest_thermostat.git (at master@f4303b0)
Bundle complete! 3 Gemfile dependencies, 11 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from httparty:
When you HTTParty, you must party hard!

Tim-rMBP:Nested Tim$ bundle show nest_thermostat

Tim-rMBP:Nested Tim$ ./nested.rb
/Users/Tim/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- nest_thermostat (LoadError)
from /Users/Tim/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from ./nested.rb:6:in `<main>'

Here's some environment stuff...

Tim-rMBP:Nested Tim$ which ruby

Tim-rMBP:Nested Tim$ which rvm

Tim-rMBP:Nested Tim$ which bundler

Tim-rMBP:Nested Tim$ cat /Users/Tim/.profile

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Tim-rMBP:Nested Tim$ cat /Users/Tim/.bashrc

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
Tim-rMBP:Nested Tim$

Tim-rMBP:.rvm Tim$ pwd
Tim-rMBP:.rvm Tim$ find . -name *thermostat*

Answer Source

You catted everything but your source code that's failing!

Did you do a:

require 'bundler/setup'

In your source? From there you should be able to use the objects in your dependencies.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download