Terminal window is not accepting commands - ruby-on-rails

I have used PHP for quite sometime now. But I want to be a ROR developer. I would love to know of the process to create a website in Ruby. Well !!! I am getting an error "DL is deprecated please use Fiddle" and the terminal window is not accepting any command. Can anyone please tell how to proceed?

Related

Why ruby cannot run the .rb files? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am a beginner just starting to learn ruby. The tutorials I have been reading say that I can create a file with the extension .rb(eg. hello.rb) and run the file in the command prompt by typing ruby hello.rb. But when I create and save the file on the desktop and run it in the cmd it always gives me this error message:
C:\Windows\system32>ruby hello.rb
Traceback (most recent call last):
ruby: No such file or directory -- hello.rb (LoadError)
I searched the internet and read a lot of other tutorials but none of them seem to have any discussion on this issue.
Can someone give me any hints on this please?
Any advice or help will be greatly appreciated!
You should provide the correct path to your file, since it's not located in system32 directory, this relative path won't work. If it's on the desktop, it would be something like this, probably:
ruby %HOMEPATH%\Desktop\hello.rb
or you can change your current directory to desktop before you start playing with ruby:
cd %HOMEPATH%\Desktop
from now on, you can easily use relative path, since hello.rb is located in the same directory you're in currently in your command line:
ruby hello.rb
I'm not quite sure of exact syntax etc, I don't use Windows cmd very often - you would have to experiment on your own.
There may be context menu option like "open command line here" in Windows, but I'm not sure of it as well.
Also, you may need to learn basics of command line even before you start to learn Ruby.

How to reload rails environment? Is `reload!` command depracated?

I tried to reload rails environment with the reload! command, I think it might be depracated. Does anyone know the modern way of reloading the rails environment? This book is available free for download, Im on page 79, it's Michael Hartl's "RailsSpace: Building a social networking website with ruby on rails", published in 2007, several people suggested that I give up on the book already, I just wanted to make sure it wasn't a modern way of doing things before I gave up on the book. So many experts on stackoverflow helped me get through the book already, I decided to take my chances.
Here is a link to the book: https://pdfs.semanticscholar.org/ca98/3b5098cd5957dc1842bb4bf3175406624bca.pdf?_ga=2.121598472.1814901715.1569094472-1963651489.1569094472, its one of the only FREE sources out there for building a social media website thats why I cant give up on it so easily, even though it was published in 2007 and its a bit outdated. Plus I just want to see what stackoverflow can do for me before I just give up on the book. So many experts on stackoverflow helped me make it this far, Im curious to find out if I can get through the entire book with stackoverflow. If anyone knows a better source that's free, please send me a link. Right now page 79, is the roadblock, its that reload! command that might be depracated. Maybe its an expert on stackoverflow that knows the knew command for it. If that's you please help. I already tried googling it, it took me straight here to stackoverflow lol. I decided to post a question of my own, that other guy's question doesn't seem to match mine so here I am. Please help if you can.
Within the Rails console (rails c, or more formally bundle exec bin/rails c) you should be able to run:
reload!
That reloads the active environment, specifically anything within app/ and config/routes.rb, but other things will not be reloaded until you exit and restart the console. This has always been the case.
Note that this is only within the Ruby interactive environment, as in you'll have a prompt that looks like this:
irb(main):001:0>
If you see something else you may not be in the Rails console and are trying to run the command in the wrong context. A common mistake is trying to run this in he shell itself where you'll get an error like:
-bash: reload!: command not found
One other thing you may need to do if you're having trouble getting things to load that should be there is to stop the Spring launcher, forcing it to reload:
spring stop
That kicks the Spring application preloader which can sometimes get confused about what's going on and needs a reset.

Error message when starting Ruby on Rails server

hope I can get some help with a problem I have been having. I am getting into Ruby on Rails and used a tutorial (http://guides.rubyonrails.org/getting_started.html) to try to get started with it. It says I need Sqlite3. I followed the steps up to the point where it says to use the ruby bin\rails server command in command prompt. However, when I try to do this, I get the following error message.
When I try to install Sqlite3, I use the x86 version for Windows, as I am using Windows 8.1.
I don't know what I am doing wrong...I am not even sure if the SQlite3 files are in the right place. I use command prompt to check if I have Ruby, Rails, and Sqlite3 all installed, which I do. I also know I have the SQlite3 Ruby gem installed. I have also added SQlite3 to my PATH system variable, but that doesn't seem to work either. I always get the same above error message no matter what I do.
Anyone have any ideas as to what the problem might be? Any help would be greatly appreciated! Thanks!
I recommend setting up a Linux VM on your Windows PC and start coding on it instead of on Windows. You'll keep encountering many issues in the future if you stick with Windows. Windows & ruby on rails don't go well together. So, it's better to go with some Linux flavor or preferably Mac.
If you are going to be learning RoR with the goal of ever doing anything serious in the future, here's the best advice I can give to someone starting out: Buy a Mac. NEVER try to use Microsoft for anything but Microsoft office... you'll just end up so frustrated that you will give up. RoR is NOT the toy to try "round peg, square hole" with.
Next, being that your on a Mac, NEVER use sqlite3. You can easily use the correct database which is PostgreSQL. Why is this important?
You're starting out. Keep things very simple. Get a free Heroku account, and install the CLI (for mac). You can then do: "heroku local" to run your code locally (for building), and because it's Mac/PostgreSQL, when you go to push that code live, everything is the same (Heroku is going to be PostgreSQL) so you won't get lost for days trouble shooting the differences between where you're building the code, and where you're running the code.

Heroku won't serve Ember/Rails app resources [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have built a basic CRM app to learn Ember. The app uses a Rails back end; and Ember and Rails communicate with a JSON api. Feel free to check out the source code on my GitHub. The app is hosted here.
The app works great in my development environment, and deploys to Heroku with no issues whatsoever.
However, when I navigate to the apps URL I see a blank page. Further inspection using Chrome's dev tools tells me that none of my javascript files were sent from Heroku to my browser. What gives?
The solution was to add the rails_12factor gem to my Gemfile. It looks like for any Rails/Ember app to work correctly on Heroku, this gem is required.
As per Heroku:
Heroku integration has previously relied on using the Rails plugin
system, which has been removed from Rails 4. To enable features such
as static asset serving and logging on Heroku please add
rails_12factor gem to your Gemfile.

how to debug web server on RoR?

I currently have a problem with a project.
it freezes before it shows the "Started GET ...." seems like it hits an infinite loop.
now i dont really have much experience with debuggers in ROR, can anyone recommend anything i can use to trace the exact origin of the problem. if i can get an error code somewhere then i might be able to fix it.
currently i am using webrick, i tried thin and it gave the exact same error.but i am willing to use anything to find the exact origin of this error.
it seems to be related to the project because all other projects works fine on my environment.
Take a look at the Rails guide on debugging.
Also try running the Rails console ("rails c"); if you can get to a command prompt at all that means that the issue is not in loading the Rails environment (e.g. a problem in application.rb) but is somewhere in the process of making a web request. If there's a failure it may give you a better error message.

Resources