I'm frequently starting up rails console or rails server or using other command line ruby apps. The bootstrap takes several seconds, which becomes tedious after a while.
Is there any way I can either run a compiled version, or keep it loaded using something like spork, so running 'heroku logs' runs instantly, rather than taking 10 seconds to start up?
Run a compiled version of what?
Rails server and rails console take long time to load because they have to load up Ruby on Rails plus whatever your environment requires. If you want to keep instances running then just open up a terminal window, load your console and server, and never close them.
Have you thought of trying vagrant? it will keep your instance running to you want them to stop.
Related
Using Rails 6 and puma-dev. I notice whenever I add a gem, or change a config file, Rails doesn’t pick up the changes or new gem. I have tried ‘touch tmp/restart.txt’ but to no avail.
Initially I thought something was wrong, until I return to my computer next morning and the app took time to reload, and everything gets well again.
I'm using puma-dev. All I needed to do was to kill puma and reload my app. Run puma-dev --stop to kill.
I'm using ROR on a Ubuntu server.
I remember the first time I start ROR use rails s,
I can see all logs, server status in the window
Now I start it as background function.
When I need to check the log, I need to open WinSCP, find development log the huge file and open it.
The time for downloading the file takes minutes.
Actually I dun need to see all log, I need only view last say 10-20 lines.
How can I do that?View last 10-20 development log without influence the ROR server.
This should work (assuming that you're already in your Rails project's main directory):
tail -f -n=20 log/development.log
Also, this command is outputting new lines continuously as they appear in log (because of modifier -f).
I am working with a UDP server in rails and I have the server called from my config/initializers folder.
If I run the code thread_a=Thread.new{UDPserver()} then the the code works fine however the code eventually switches off, I presume once my rails script stops running.
If I write
thread_a=Thread.new{UDPserver()}
thread_a.join
then my whole web program doesn't work and I presume this is because my program is waiting till the threads finish (which they don't) until it loads up the rest of the program.
What am I to do?
Notes:
The reason I am running a thread is because I need my program to be constantly waiting for UDP messages and then to react. Also, I need my standard we program to be up at the same time.
ruby 1.9.3p194
Rails 3.2.12
I have a Rails application that requires a bunch of environment stuff to get set up, and right now the easiest way for me to do it is to run a batch file to configure the environment and then launch the server from the command prompt. (Perhaps one day I will bite the bullet and transcribe all of the various environment variables into the project config, but I'd rather not...)
But when I do this, I occasionally manage to crash conhost.exe! It does not seem like I should be able to do this. Stranger still, it seems to happen most often if I access certain records in the application. I can't imagine it could crash if there were too much console output???
I am also having mscvrt-ruby.dll crashes, although I may have resolved those by doing some gem finagling. The conhost issue may or may not be related, I'm not sure. But if I launch the server from within RadRails, I don't seem to get these issues (the app doesn't completely work because of the missing environment stuff, but it seems much more stable).
Technicals: Windows 7, Rails 2.3.5, Ruby 1.93, Mongrel 1.2.0pre, uh, not sure what else...
Thoughts?
I'm looking for a tool or gem or something to allow me to run ruby methods every certain time.
I've tried many ways to do this like backgroundRB, whenever and starling and workling, the main problem is that we have to automate the tasks in Windows 7, we can't use cron.
BackgroundRB is not being updated, so we can't install it in ROR 3.0.3 or 3.0.9
What I need to do is to monit an event, using rake from the outside takes too long to load and will produce a timeout in a secondary system, so i need to run the methods from the 'inside' without loading all the environment every time.
There are many articles about this, but most of them are not updated, so I need a current suggestion, thanks in advance
Why not use the built in Windows Task Scheduler and batch or VBScripts? Even powershell could work.