ccjr / alpaca-trade-api

MIT License
32 stars 28 forks source link

Gem Load Error? #2

Closed khalidfoflonker closed 4 years ago

khalidfoflonker commented 5 years ago

C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- alpaca-trade-api (LoadError)

any ideas? My apologies if this is elementary.

ccjr commented 5 years ago

Can you share how you're including and using the gem?

klepsydra commented 5 years ago

Gemfile:

gem 'alpaca-trade-api'

gem install alpaca-trade-api Fetching: alpaca-trade-api-0.3.0.gem (100%) Successfully installed alpaca-trade-api-0.3.0 1 gem installed

bundle install Fetching gem metadata from http://rubygems.org/...... Fetching gem metadata from http://rubygems.org/. Resolving dependencies.............. Using rake 13.0.1 Using concurrent-ruby 1.1.5 Using i18n 1.7.0 Using minitest 5.13.0 Using thread_safe 0.3.6 Using tzinfo 1.2.5 Using zeitwerk 2.2.1 Using activesupport 6.0.1 Using builder 3.2.3 Using erubi 1.9.0 Using mini_portile2 2.4.0 Using nokogiri 1.10.5 Using rails-dom-testing 2.0.3 Using crass 1.0.5 Using loofah 2.3.1 Using rails-html-sanitizer 1.3.0 Using actionview 6.0.1 Using rack 2.0.7 Using rack-test 1.1.0 Using actionpack 6.0.1 Using activemodel 6.0.1 Using activerecord 6.0.1 Using public_suffix 4.0.1 Using addressable 2.7.0 Using multipart-post 2.1.1 Using faraday 0.17.0 Using alpaca-trade-api 0.3.0 Using io-like 0.3.0 Using archive-zip 0.12.0 Using ast 2.4.0 Using execjs 2.7.0 Using autoprefixer-rails 8.1.0.1 Using bindex 0.8.1 Using bundler 1.17.3 Using byebug 10.0.2 Using mini_mime 1.0.2 Using xpath 3.2.0 Using capybara 2.17.0 Using json 2.2.0 Using capybara-webkit 1.15.1 Using ffi 1.11.2 Using childprocess 0.9.0 Using chronic 0.10.2 Using colorize 0.8.1 Using docile 1.3.2 Using simplecov-html 0.10.2 Using simplecov 0.16.1 Using tins 1.22.2 Using term-ansicolor 1.7.1 Using thor 0.20.3 Using coveralls 0.8.23 Using csv 3.1.2 Using declarative 0.0.10 Using declarative-option 0.1.0 Using diffy 3.2.1 Using equivalent-xml 0.6.0 Using et-orbi 1.2.2 Using faraday_middleware 0.13.1 Using sax-machine 1.3.2 Using feedjira 3.0.0 Using raabro 1.1.6 Using fugit 1.3.3 Using geckodriver-helper 0.24.0 Using jwt 2.2.1 Using memoist 0.16.1 Using multi_json 1.14.1 Using os 1.0.1 Using signet 0.12.0 Using googleauth 0.10.0 Using httpclient 2.8.3 Using uber 0.1.0 Using representable 3.0.4 Using retriable 3.1.2 Using google-api-client 0.34.1 Using hashie 4.0.0 Using mime-types-data 3.2019.1009 Using mime-types 3.3 Using multi_xml 0.6.0 Using httparty 0.17.1 Using money 6.13.4 Using money_helper 1.0.2 Using iex-ruby-client 1.1.0 Using kaminari-core 1.1.1 Using kaminari-actionview 1.1.1 Using kaminari-activerecord 1.1.1 Using kaminari 1.1.1 Using rb-fsevent 0.10.3 Using rb-inotify 0.10.0 Using ruby_dep 1.5.0 Using listen 3.1.5 Using logger 1.4.1 Using mail 2.7.1 Using metaclass 0.0.4 Using method_source 0.9.2 Using mocha 1.3.0 Using parallel 1.19.0 Using parser 2.6.5.0 Using powerpack 0.1.2 Using pp 0.1.1 Using puma 3.11.4 Using rails-controller-testing 1.0.4 Using railties 6.0.1 Using rainbow 3.0.0 Using ruby-progressbar 1.10.1 Using unicode-display_width 1.6.0 Using rubocop 0.55.0 Using rubyzip 1.3.0 Using rufus-scheduler 3.6.0 Using selenium-webdriver 3.9.0 Using sqlite3 1.3.13 Using stock_market_days 1.0.0 from https://github.com/wakproductions/stock_market_days.git (at master@92c6ce6) Using table_print 1.5.6 Using timeout-extensions 0.1.1 Using timeout 0.0.1 Using web-console 3.5.1 Bundle complete! 35 Gemfile dependencies, 115 gems now installed. Use bundle info [gemname] to see where a bundled gem is installed.


Yet:

irb irb(main):001:0> require 'alpaca-trade-api' Traceback (most recent call last): 4: from /home/master/.rbenv/versions/2.5.6/bin/irb:11:in <main>' 3: from (irb):1 2: from /home/master/.rbenv/versions/2.5.6/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire' 1: from /home/master/.rbenv/versions/2.5.6/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' LoadError (cannot load such file -- alpaca-trade-api) irb(main):002:0>

klepsydra commented 5 years ago

Okay, so I figured out that this way works:

require 'alpaca/trade/api'

So either the documentation/main page lacked mention of this, or I didn't know not to merely follow the name of the gem and was erroneously doing require 'alpaca-trade-api' like with most other gems.

ccjr commented 4 years ago

Example added to README: https://github.com/ccjr/alpaca-trade-api#example.