Ruby in VS code not printing - ruby-on-rails

I have downloaded ruby on VS code and everything seems to be installed find but when I'm doing a simple puts statement, its not printing, how can I fix this>z
[Ruby Installation](https://i.stack.imgur.com/GJCOa.png)
[Ruby Installation](https://i.stack.imgur.com/8l4zy.png)
[The console after running](https://i.stack.imgur.com/5ukqG.png)
[Ruby version](https://i.stack.imgur.com/OhHu2.png)
I have downloaded everything and even a code runner but it still doesn't print on the console.

Related

Rails test unit access denied rename

I'm new here. I search everywhere and I haven't found anything. I'm using rails on windows 10. I'm following the basic tutorial of a sample app. When I execute "rails test" command in the console I get the following errors. I checked the permissions of each file and directory and all have the permissions needed. Can someone help me ?
I'm using rails 6.0.2.2 version.
Hope I'll get answer here.
Solution : I installed ubuntu on windows 10.
Stop your rails server before executing your tests: the server is keeping cache files locked and the testing framework is trying to alter them.
I encountered the same issue (while following what's probably the same tutorial you were following) on Rails 6.0.3.4 on Windows 10 and doing so solved it. (launching the server again before executing tests reproduced it again)
Update: I thought this was a complete solution, but it's more complex than that. Here's my experience:
running rails test while rails server is running results in the error;
running rails test when rails server is not running sometimes results in the error.
I haven't encountered this error on Linux so far, so my guess is that the implementation of Rails of Windows is unstable and sometimes gets stuck locking its own files.
You can check if you can reproduce the same behaviour, but I would report it as a bug.

ruby on rails console isn't working, I am getting"Switch to inspect mode" on windows

When I run my rails console it is saying "Switch to inspect mode" .I am working on windows . Kindly help !
This is likely due to the terminal you're using, not the console itself. (Which terminal are you using...?) Try running $ irb and seeing if you're getting the same issue.
I had the same issue a while back, and momentarily fixed it by changing the irb config output mode, but it still tended to break elsewhere. I recommend using ConEmu to permanently squash the annoyance.

GIT Bash MingW32 Rails Console - Text input fails after exit and restart console

I installed Rails and I am having issues with the Rails console in Git Bash (MINGW32).
The first time I launch the Rails console using rails c, I can input text and everything works as expected. However if I exit the rails console using Ctrl-C then start the Rails console again, the text input is wrong.
In the example, I started the Rails console, input "Zombie.first", got the expected response, exited the console, started it again, entered "Zombie.first" again, but the console actually executes "Zoiefr". Any text I enter after this will be similarly affected until restarting git bash.
I performed the RailsInstaller install on two different Windows machines with the same result.
Does anybody have suggestions for how to fix it, or for other Windows development environments to try?

Ruby and Rails have stopped working completely on my machine

I've been learning Ruby slowly over the last few weeks, and have been making methods using Sublime Text 2. I've been running these scripts in the terminal command line
ruby file_name.rb
These scripts have been running great in the terminal. I then wanted to start using Rails, so updated my current Rails version using RVM. However during install I kept getting error messages about needing Xcode or command line tools to be installed (both of which were installed). I quit out of that installation, and went back to testing out some ruby stuff.
However, now ruby and rails don't work at all. Even running
ruby -v
Nothing happens. I don't get a warning or an error, but my terminal simply switches the top bar from bash to env and back and forth constantly without anything happening. It just displays an empty line and not another command line. I then have to quit out of the script by pressing Control-C.
What happened? I tried reinstalling ruby but it's not working. I'm really confused...

How To:Debugging Rails 3.1.x app(Ruby 1.9.3) on Aptana Studio3 in Ubuntu

Is rails debugging supported on Aptana Studio 3. I have earlier debugged Rails applications on Aptana Studio2 with the embedded browser and embedded servers.
1)How to start rails application in Debug Mode?
2)How to enable remote debugging in firefox?
My work environment is as follows and I have been using RVM
Rails 3.1.x
Ruby 1.9.3
Ubuntu 10.10
I have already installed the debug related gems
ruby-debug-base19 (0.11.25)
ruby-debug-ide19 (0.4.12)
Try removing (commenting out) ruby-debug-base19 from Gemfile. "ruby-debug-ide" should be enough, judging from the comments from a post on different IDE - RubyMine.
For debugging, right click on the project and select "Server Debug", then open the site manually in firefox (you will see the address/port the server listening to in the console). I did not manage to set a breakpoint this way, but I only had a test project with no logic in it, so I am not sure how well it works on a real project.
Not sure about your question on "remote debugging with Firefox".
Answer for Q1: Aptana is just an IDE which provides you a not bad interface to input code. I don't think it a very good idea to 'DEBUG' in it.
For me, debugging rails depends on : command line, unit tets and log files. you should first of all, write an failed unit test, then run it in the command line, and write the implementation code, then run unit test, then write implementation code ... sometimes you need to check the output/log file, finally , the unit tests bar turns to green and your code is implemented.
hope this post useful to you:
How to configure aptana for instant running of my script
Answer for Q2: I don't know your "remote debugging in firefox". If you want to show detailed error message to someone else, just start your server as "development" mode. e.g.
rails s -p 3000 -e development
or just:
rails s

Resources