how do I get a my cli app to move on to the next method?How to get a random number in RubyHow to get last N records with activerecord?Do we use Rails ActiveRecord as a Hybrid Structure, i.e. Data Structure+Object?How do I get the current absolute URL in Ruby on Rails?How to get the name of the calling method?How to remove a key from Hash and get the remaining hash in Ruby/Rails?Learnstreet Ruby Lesson 11.5 Transfer state between objectsRuby loop and arrayHow to use ruby's named parameters (keyword arguments) more ellegantly (no duplicated code)?Error ActiveRecord::PendingMigrationError

Why we don't have vaccination against all diseases which are caused by microbes?

Are required indicators necessary for radio buttons?

How should I think about joining a company whose business I do not understand?

How can I run SQL Server Vulnerability Assessment from a SQL Job?

What is the improvement of the "legally binding commitment" proposed by Boris Johnson over the existing "backstop"?

Are there any plans for handling people floating away during an EVA?

Can we save the word "unique"?

Defense against attacks using dictionaries

Can you feel passing through the sound barrier in an F-16?

Is it appropriate for a prospective landlord to ask me for my credit report?

What can I do to keep a threaded bolt from falling out of its slot?

Does Swashbuckler's Fancy Footwork apply if the attack was made with Booming Blade?

Does C++20 mandate source code being stored in files?

How do I find the fastest route from Heathrow to an address in London using all forms of transport?

Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?

Does Git delete empty folders?

How to specify and fit a hybrid machine learning - linear model

How to persuade recruiters to send me the Job Description?

Dark side of an exoplanet - if it was earth-like would its surface light be detectable?

Was Tuvok bluffing when he said that Voyager's transporters rendered the Kazon weapons useless?

Is refusing to concede in the face of an unstoppable Nexus combo punishable?

Do I have to learn /o/ or /ɔ/ separately?

(Why) May a Beit Din refuse to bury a body in order to coerce a man into giving a divorce?

What is the difference between a premise and an assumption in logic?



how do I get a my cli app to move on to the next method?


How to get a random number in RubyHow to get last N records with activerecord?Do we use Rails ActiveRecord as a Hybrid Structure, i.e. Data Structure+Object?How do I get the current absolute URL in Ruby on Rails?How to get the name of the calling method?How to remove a key from Hash and get the remaining hash in Ruby/Rails?Learnstreet Ruby Lesson 11.5 Transfer state between objectsRuby loop and arrayHow to use ruby's named parameters (keyword arguments) more ellegantly (no duplicated code)?Error ActiveRecord::PendingMigrationError






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















(using tty-prompt) I've tried making individual methods so that my app can run smoothly however I only managed to break my code or set it into a infinite prompt..I've been stuck trying to set up activerecord CRUD



I made new method for each prompt



def greet
$prompt = TTY::Prompt.new
system "clear"

puts 'Welcome to gig_finder, the best resource for finding your next gig!'
end

def user
name = $prompt.ask('What is your name?', default: "artist_name")
system "clear"
puts "Welcome #user!"
end


the output would continue to ask for a name, until you force quit










share|improve this question



















  • 1





    Can you include the code where these methods are called?

    – Sara Tibbetts
    Mar 27 at 15:27











  • yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

    – Jerry Velázquez
    Mar 27 at 17:14











  • can you show the run.rb please?

    – max pleaner
    Mar 27 at 17:34











  • endP = true greet user while endP venue_selection endP = book end

    – Jerry Velázquez
    Mar 27 at 20:33












  • Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

    – pjs
    Mar 27 at 21:23

















-1















(using tty-prompt) I've tried making individual methods so that my app can run smoothly however I only managed to break my code or set it into a infinite prompt..I've been stuck trying to set up activerecord CRUD



I made new method for each prompt



def greet
$prompt = TTY::Prompt.new
system "clear"

puts 'Welcome to gig_finder, the best resource for finding your next gig!'
end

def user
name = $prompt.ask('What is your name?', default: "artist_name")
system "clear"
puts "Welcome #user!"
end


the output would continue to ask for a name, until you force quit










share|improve this question



















  • 1





    Can you include the code where these methods are called?

    – Sara Tibbetts
    Mar 27 at 15:27











  • yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

    – Jerry Velázquez
    Mar 27 at 17:14











  • can you show the run.rb please?

    – max pleaner
    Mar 27 at 17:34











  • endP = true greet user while endP venue_selection endP = book end

    – Jerry Velázquez
    Mar 27 at 20:33












  • Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

    – pjs
    Mar 27 at 21:23













-1












-1








-1








(using tty-prompt) I've tried making individual methods so that my app can run smoothly however I only managed to break my code or set it into a infinite prompt..I've been stuck trying to set up activerecord CRUD



I made new method for each prompt



def greet
$prompt = TTY::Prompt.new
system "clear"

puts 'Welcome to gig_finder, the best resource for finding your next gig!'
end

def user
name = $prompt.ask('What is your name?', default: "artist_name")
system "clear"
puts "Welcome #user!"
end


the output would continue to ask for a name, until you force quit










share|improve this question














(using tty-prompt) I've tried making individual methods so that my app can run smoothly however I only managed to break my code or set it into a infinite prompt..I've been stuck trying to set up activerecord CRUD



I made new method for each prompt



def greet
$prompt = TTY::Prompt.new
system "clear"

puts 'Welcome to gig_finder, the best resource for finding your next gig!'
end

def user
name = $prompt.ask('What is your name?', default: "artist_name")
system "clear"
puts "Welcome #user!"
end


the output would continue to ask for a name, until you force quit







ruby activerecord command-line-interface






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 15:20









Jerry VelázquezJerry Velázquez

4




4










  • 1





    Can you include the code where these methods are called?

    – Sara Tibbetts
    Mar 27 at 15:27











  • yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

    – Jerry Velázquez
    Mar 27 at 17:14











  • can you show the run.rb please?

    – max pleaner
    Mar 27 at 17:34











  • endP = true greet user while endP venue_selection endP = book end

    – Jerry Velázquez
    Mar 27 at 20:33












  • Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

    – pjs
    Mar 27 at 21:23












  • 1





    Can you include the code where these methods are called?

    – Sara Tibbetts
    Mar 27 at 15:27











  • yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

    – Jerry Velázquez
    Mar 27 at 17:14











  • can you show the run.rb please?

    – max pleaner
    Mar 27 at 17:34











  • endP = true greet user while endP venue_selection endP = book end

    – Jerry Velázquez
    Mar 27 at 20:33












  • Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

    – pjs
    Mar 27 at 21:23







1




1





Can you include the code where these methods are called?

– Sara Tibbetts
Mar 27 at 15:27





Can you include the code where these methods are called?

– Sara Tibbetts
Mar 27 at 15:27













yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

– Jerry Velázquez
Mar 27 at 17:14





yes, the methods are being called in a run.rb file (calling: greet, then user, etc.)that requires the environment, and the environment requires all files in a lib dir

– Jerry Velázquez
Mar 27 at 17:14













can you show the run.rb please?

– max pleaner
Mar 27 at 17:34





can you show the run.rb please?

– max pleaner
Mar 27 at 17:34













endP = true greet user while endP venue_selection endP = book end

– Jerry Velázquez
Mar 27 at 20:33






endP = true greet user while endP venue_selection endP = book end

– Jerry Velázquez
Mar 27 at 20:33














Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

– pjs
Mar 27 at 21:23





Place your run.rb code in the question itself, please. Your question should be self-contained, and include everything needed for others to reproduce your problem.

– pjs
Mar 27 at 21:23












1 Answer
1






active

oldest

votes


















1














Because in your user method you call the user method again.



def user # <--- user
name = $prompt.ask('What is your name?', default: "artist_name")
system "clear"
puts "Welcome #user!" # <--- calls user
end


This causes an infinite loop.



You probably meant to use:



 puts "Welcome #name!"





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380762%2fhow-do-i-get-a-my-cli-app-to-move-on-to-the-next-method%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Because in your user method you call the user method again.



    def user # <--- user
    name = $prompt.ask('What is your name?', default: "artist_name")
    system "clear"
    puts "Welcome #user!" # <--- calls user
    end


    This causes an infinite loop.



    You probably meant to use:



     puts "Welcome #name!"





    share|improve this answer





























      1














      Because in your user method you call the user method again.



      def user # <--- user
      name = $prompt.ask('What is your name?', default: "artist_name")
      system "clear"
      puts "Welcome #user!" # <--- calls user
      end


      This causes an infinite loop.



      You probably meant to use:



       puts "Welcome #name!"





      share|improve this answer



























        1












        1








        1







        Because in your user method you call the user method again.



        def user # <--- user
        name = $prompt.ask('What is your name?', default: "artist_name")
        system "clear"
        puts "Welcome #user!" # <--- calls user
        end


        This causes an infinite loop.



        You probably meant to use:



         puts "Welcome #name!"





        share|improve this answer













        Because in your user method you call the user method again.



        def user # <--- user
        name = $prompt.ask('What is your name?', default: "artist_name")
        system "clear"
        puts "Welcome #user!" # <--- calls user
        end


        This causes an infinite loop.



        You probably meant to use:



         puts "Welcome #name!"






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 7:20









        Kimmo LehtoKimmo Lehto

        4,7001 gold badge15 silver badges29 bronze badges




        4,7001 gold badge15 silver badges29 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380762%2fhow-do-i-get-a-my-cli-app-to-move-on-to-the-next-method%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현