Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:54:30+00:00 2026-06-07T07:54:30+00:00

You can see everything in the file structure at github.com/ddd1600/simple_angel I’m getting alot of

  • 0

You can see everything in the file structure at github.com/ddd1600/simple_angel

I’m getting alot of errors while trying to create a ruby application (soon to be a gem) “the correct way”, viz. by thoroughly dividing the logic into classes and “loader files” and all of that. Point is, I know how to do this code the simpler way, without obeying OO principles, but I want to do it “correctly”.

So, first of all, the file structure is as follows—

root folder = ~/Develop/simple_angel

inside /simple_angel
  - /lib
  - Gemfile
  - Rakefile
  - simple_angel.gemspec

inside /lib
  - simple_angel.rb
  - /simple_angel

inside /lib/simple_angel
  - company.rb
  - search.rb
  - version.rb

But, here are some basics.

Here is what I’m calling to run this program from the terminal (PATH when running is ~/Develop/simple_angel)

ruby -Ilib lib/simple_angel/search.rb

Here is search.rb

#these 'requires' are supposed to be loaded in lib/simple_angel.rb, so here I show
#them commented out
#
#require 'rubygems'
#require 'httparty'
#require 'json'
#require 'company'

module SimpleAngel
  class Search

  SEARCH_URL = "http://api.angel.co/1/startups"

  def search(user_input)

    response = HTTParty.get("#{SEARCH_URL}/#{user_input}")
    parsed_response = JSON.parse(response.body)

    Company.new(parsed_response)

  end
 end  

 s = SimpleAngel::Search.new
 s = Search.new
 x = s.search(6702)
 p x
 end

Here is the “loader” file, lib/simple_angel.rb (PS: what is a more formal title for this sort of file?)

require 'httparty'
require 'json'
require 'simple_angel/search'
require 'simple_angel/version'
require 'simple_angel/company'

module SimpleAngel

end

Lastly, when I (again), run “ruby -Ilib lib/simple_angel/search.rb” (with all of search.rb’s ‘requires’ commented out (^&^), this is my error message:

[ddouglas@coders:~/Develop/simple_angel on master]
% ruby -Ilib lib/simple_angel/search.rb                                       
lib/simple_angel/search.rb:15:in `search': uninitialized constant SimpleAngel::Search::HTTParty (NameError)
from lib/simple_angel/search.rb:24:in `<module:SimpleAngel>'
from lib/simple_angel/search.rb:8:in `<main>'

^&^ – now that we’re all up to speed here, I might as well include the error that happened when I left search.rb’s “requires” in place

% ruby -Ilib lib/simple_angel/search.rb                                       ✹
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- company (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from lib/simple_angel/search.rb:6:in `<main>'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:54:31+00:00Added an answer on June 7, 2026 at 7:54 am

    I can’t say I understand the point the class is trying to make regarding splitting up your files.

    The first error (uninitialized constant SimpleAngel::Search::HTTParty) is because from within SimpleAngel::Search, you call HTTParty. Try changing that to ::HTTParty to specify the root namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't see where I'm going wrong. I've tried everything I could think of,
Hi can you see what is the problem with it. Cuz everything shows correct
I can see the Graphical Layout of the XML file within the /res/layout folder,
I can see there are a lot of questions for getting the number of
I can see it looks like an alias for an unsigned int pointer, right?
I can see where svn:keywords like Id, LastChangedDate and Author are used and replaced
I can see how to change the fonts and colors in the IDE. Is
I can see that GD library is for images. But I can't see differences
I can see some potential difficulties with this concept but the idea is: I
I can see that Collections.unmodifiableSet returns an unmodifiable view of the given set but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.