Sublime Text 3 and Rails: manage an app on a remote server - ruby-on-rails

I'm new to Sublime Text and recently discovered the wonderful SFTP plugin on Sublime Text 3, which lets you work with a local folder and sync it to a remote server directory.
I have some questions:
is it possible to sync the folder automatically once files are created or deleted, either locally or remotely, instead of clicking everytime on Sync Local -> Remote or viceversa?
is it possible to launch rails or rake commands from the Sublime console to the remote server and after that sync the local folder contents automatically?
My local machine runs Windows 10 whereas my remote server is a Ubuntu 16.04.
Thanks in advance

Is it possible to sync the folder automatically once files are created or deleted, either locally or remotely, instead of clicking everytime on Sync Local -> Remote or viceversa?
Yes, but only for the files changed locally. Check upload_on_save.
Is it possible to launch rails or rake commands from the Sublime console to the remote server and after that sync the local folder contents automatically?
You cannot run such commands using a FTP client. You will need SSH access to the server for that.
A work around would be to set up a listener on your server that will trigger rails commands when files are changed.

Related

PhpStorm SFTP won't write to remote host (AWS EC2)

I was able to connect SFTP to my AWS EC2 instance, and I can see all the files and browse through them, open them up in PhpStorm etc..., but when I make a change and save any file in PhpStorm, then refresh the page on my browser the change doesn't show up.
It works if I physically do it in VIM, but PhpStorm SFTP is not writing my changes to the remote host
Is there an extra configuration step I need to do to get it to write to the host as soon as a file changes?
One thing I did notice - If I choose the menu options Tools | Deployment the options to upload are greyed out.
Any help is greatly appreciated.
Ok so the answer is that the files were under a different ownership.
So I had to go to the root and execute:
$ sudo chown -R ec2-user:ec2-user *
And that worked.

Database disappearing on OpenShift (OSE) running Postgres and Rails 4 / Ruby 2

I have Ruby (2) on Rails (4) app deployed on OpenShift Enterprise running a Postgres database. After initial deployment the app worked perfectly, information was persisted in the database, routing was working, all the tests were passing - everything was good.
Then I deployed some new changes with git push openshift master. When I went back to the app it was still running, but all the database content (including table structure) was gone.
The output from the push was clean. I didn't write any hooks, or have any funky cron jobs running. I could repeat the process, rebuilding the database, and watch it get blown away on every deployment. This problem was not occurring in my local instance.
tl;dr: Make sure you have a .openshift directory at your project's root, use this as an example: https://github.com/openshift/rails4-example
Here's what was going on.
When I created the Rails app I didn't know where I would end up deploying it. Consequently I didn't start with an OpenShift Rails skeleton app or by using rhc app create ruby-X.X.X -a railsX.
When I was told to deploy on open shift I just configured rhc and set up an openshift git remote.
This meant there was no .openshift directory in my project's root. Once I cloned https://github.com/openshift/rails4-example and moved that project's .openshift directory into my project root I was able to deploy without losing my database.

How do you setup a RubyMine rails project to work with a remote ruby install?

My dev machine is running Windows, IntelliJ Idea 13 (EAP), and VirtualBox. I run a virtual linux server with ruby (setup to match the production server I'll deploy to). I have configured IntelliJ to use the ruby SDK on the (virtually) remote server, but I am having problems creating new rails projects because it is trying to pass windows local paths to the remote ruby install.
On my windows, I try to create the project in D:\Projects\MyRubyProject
On the VM, that dir maps to /projects/MyRubyProject
In the new project dialog, I would like to set the content root to /projects/MyRubyProject, but if I do it says it doesnt exists and ask to create it, when it creates it, it is created in the IntelliJ install dir. I tried giving it the same type of ssh:// path that the remote SDK accepts, but it just silentl fails.
Any suggestions or is this something that is just not supported?
i tried also.
just use "Configuring Remote Interpreters via Virtual Boxes" https://www.jetbrains.com/ruby/webhelp/configuring-remote-interpreters-via-virtual-boxes.html
Rubymine don't offer the possibility to create new rails project remotely.

Trying to change views of a rails application but changes don't apply

I am trying to change the html.erb files from my application, but when i upload the new version and i check with a browser it's still the old one, i tried different browsers/cleared cache.
Do I need to restart the app? if so, how do i do that?
You say you are "uploading the new version" which suggests that you're talking about a server run in production mode (e.g. not your local development environment). In that case, yes, you likely need to restart your application server. E.g. if you are running with Apache/Passenger, then restart Apache.

Cannot get the remote debugger for Delphi 2007 to work correctly?

I followed these instructions while trying to get remote debugging working with Delphi 2007. After completing all the steps, the remote debugger is half working.
It is able to launch and halt the application but the break points I set do not work. The automatic break point (at line Application.Initialize;) is working but it goes right to the CPU window. The debugging information appears to be missing.
I triple checked, both 'Include TD32 debug info' and 'Include remote debug symbols' are checked, a clean build was performed, and the correct files have been moved to the remote machine.
What am I missing?
Any help would be greatly appreciated.
You might like to go through my own checkist for this, which is as follows. I hope its not too patronising, but there may be a step you've omitted. I also seem to recall that it was improtant to use IP addresses, not names. Also note that these instructions are for D7, howver I'm not aware that the principle has changed.
=======
In this description, TARGET refers to the machine being debugged (i.e the remote machine) and HOST refers to the machine being used fro debugging (i.e the local machine).
If necessary, install the remote debugger on the target by copying the RDEBUG folder to the target and running SETUP.
Run the remote debugger locally on the target using Start | Borland Remote Debugger | Remote debugger. A ‘spider’ icon should appear in the task bar. (It can be useful to double-click on this icon to obtain a connection status dialog – this shows how the local IDE is connecting to the remote in later steps here).
On the host machine, explode the project to be debugged. Check that this compiles locally and runs offline.
By convention, copy the SOFTWARE ROOT folder from the host to the target. This will be the working folder for the application when debugged. By copying the folder in its entirety, all support files will be found locally as needed. (This also fits nicely with using SecondCopy to duplicate the entire ART software tree on a remote machine and then to explode the required project – this will create the remote folder for you).
In the Delphi IDE on the local machine, use Run | Parameters | Remote to set the Remote Path to the remote exe file in the folder you have just copied, as it will be visible on the target machine. If you’ve copied it as instructed in ‘4’, this path will be identical to the file that the local IDE would create and debug, eg “C:\Art_Soft\RT290\Bench\Dev4all\RT290w.exe”
In the Delphi IDE on the local machine, use Run | Parameters | Remote to set Remote Host to the IP address of the target (you should use IPCONFIG on the target to find out what the IP address is). Before leaving the dialog, select ‘Debug Project On Remote Machine’.
Enable “Include remote debug symbols” on the “EXE and DLL options” pane under Project|Options|Linker
Compile and run the file from the IDE. The remote connection status should show connection progress and a the remote screen should show the application running.
What are the correct files? I assume both the .exe and .rsm file?
(disclaimer: I only know remote debugging in D2009)

Resources