Running Rails in Rubymine from subproject - rubymine

I'm using RubyMine 3.1.1 with Rails 3.0.9.
I have the Spree project cloned from Github, and I want to debug the server while working on the code. To do this, Spree includes a sandbox rake command that creates a subfolder (called sandbox) that contains an instance of the rails app, one that refers to the parent directory containing the source as its spree gem.
If I close the original project and open the sandbox subfolder as a new probect, I get the correct run configurations for development and production and I can successfully debug. However, this doesn't let me edit the spree code in the parent directory.
If I'm in the parent directory, the subfolder is there of course, but there's no rails run configurations and you can't add one as it says there is no rails server launcher in the project (or some facsimile of that message).
Anyone know how to make RubyMine recognize the run configurations for a subfolder?

I ran across this conversation that resolved a very similar issue to what you're reporting.
The gist is that you can go into settings | project structure and then add your subdirectory as a source root. Then you can set up your run configuration with that subdirectory instead of the project root.

Related

Confusing Structure of Plugins and Platforms Folder

I am using Ionic framework to start on a Cordova hybrid mobile application.
Installing Ionoic via NPM was successful and had no issues.
I am running the below command in a directory as shown below.
C:\wamp\www\my_cordova\> ionic start myapp
This creates a new folder called myapp inside my_cordova folder, which is fine.
But it also creates the plugins folder in C:\wamp\www\ folder. This is the case always how much deeper I create the folder structure. Even if I start a project in C:\wamp\www\my_cordova\level1\, still the plugins folder is created in C:\wamp\www\ folder.
The same happens for platforms folder too when I add them. They are created in C:\wamp\www\ folder.
Is this expected or is it something wrong from my side? I expect all the folders(plugins and platforms) to be created within the same folder directory where I start the ionic project.
It's a problem with the CLI. As the path has "www" in it, these issues happened.
When I tried the CLI commands in another path which does now have www in it, all went fine.

Where do you put server.xml in a tomcat eclipse project when checking into version control?

When you create a tomcat project in eclipse, it puts the server.xml file under Servers, which appears as a separate "Project" in the project explorer. My question is, how best to check this into source code control, so that when another user attempts to check out the project, the server.xml file is in the correct place.
I currently use the Perforce version control system, but I've experienced the same issue in the past with other systems.
It's been my experience that other users will end up creating their own tomcat server in eclipse, and then they will have to copy in the custom server.xml.
The best I've been able to do is save the server.xml into the WEB-INF or other directory inside the project, and then update that to source code control. However, this introduces risk, because you have to remember to save your server.xml changes back to WEB-INF. Not to mention that you have to document the copying of the server.xml as a setup step for users creating your project.
I would create a folder under the web app project like etc/ where I'd put a big README and a hard link to the server.xml. So anyone checking out the project would be instructed to do the same (in the README) - and all changes to the server.xml would be versioned. I would not mess with WEB-INF - the server.xml has no place there.

Zend Framework issue in run command in netbeans

I am trying my hands on using Zend framework with netbeans.
I have setup everything correctly as i can create project using ZF command line and can create other controller and actions.
But when i setup project in netbeans and use run command it does not seems to understand Zend framework MVC url structure and shows complete path in browser.
instead of running http://testing.com/about
it is taking http://testing.com/application/controllers/AboutController.php
but when i type is manually everything seems to be working fine.
you need adjust a few settings in your project properties. Open your project properties menu and select Sources make sure your Web Root is set to public, while you're there make sure your sources and project folder are correct.
Next select Run Configuration and make sure your Project URL is correct. When using ZF there is no need to specify an index file, netbeans may complain some but it will work.
Now when want to run your project you have to run the whole project. When using ZF you can't run just one file because all request are routed through the index.php in the public folder. So Always select run at the project level and not at the file level.

How can I setup ANT with Subversion and ColdFusion Builder (eclipse) to check out a local build to work on?

I am not sure if there's an answer for this already -- couldn't find one for this (hopefully common) setup:
I recently converted one of my ColdFusion projects to deploy via ANT.
I have a local ant script that instructs a remote server to check out the code, and run the application's specific build file, remotely on the server.
I have a few endpoints:
Live - production (on the production server)
Staging - on the production server, different datasource, etc.
dev - on the local box.
What I have run into it seems is a simple and common problem. I now need ANT to create any build, even locally. Fine, created a local endpoint and it configures for my box.
Issue? How do I get it to show up as a project (automatically if possible) in Eclipse/ColdFusion builder. What I envision is instead of checking out a branch via the subversion plugin in CFBuilder/Eclipse, I now use ANT to do that for me.
Since I use ColdFusion Builder (Eclipse + Adobe's plugin), I have all of eclipse's tools and plugins available to solve the problem of : how can I best call ANT from within Eclipse/ColdFusion Builder, to setup the local build as a project that I can develop and work on?
I think when I check the code back in from the local box, I'd have to be sure not to check in any files with local config paths, etc.
I hope this is a detailed and clear enough explanation, if not, please ask.
Thanks in advance!
You won't be able to have it "automatically" show up in CFBuilder, but you can make it pretty easy.
Eclipse requires the ".project" file, which is a simple xml file that by default generally just contains the project name.
Once you check out your project from SVN, Do file -- new -- ColdFusion project and point it to the directory where you've checked out your code. This will create the .project in there. From there, you can commit that file to SVN.
Subsequent developers who check out the project from SVN can then do File -- Import -- Existing Project into workspace, and point it to their checked out location. Since it'll have the .project file in there (from when you committed it), that project will show up when they search for projects in that import wizard.
Now, that's how you'd do it if you already used ANT to check out the code. However, if you wanted a potentially even easier way, then you can just install either the Subversive or Subclipse plugin into CFBuilder, and then do
file -- new -- checkout project from svn
point to your svn url
select the directory you want to check out
choose a location where you want the code to live
click through to completion

Good Ways to Use Source Control and an IDE for Plugin Code?

What are good ways of dealing with the issues surrounding plugin code that interacts with outside system?
To give a concrete and representative example, suppose I would like to use Subversion and Eclipse to develop plugins for WordPress. The main code body of WordPress is installed on the webserver, and the plugin code needs to be available in a subdirectory of that server.
I could see how you could simply checkout a copy of your code directly under the web directory on a development machine, but how would you also then integrate this with the IDE?
I am making the assumption here that all the code for the plugin is located under a single directory.
Do most people just add the plugin as a project in an IDE and then place the working folder for the project wherever the 'main' software system wants it to be? Or do people use some kind of symlinks to their home directory?
Short answer - I do have my development and production servers check out the appropriate directories directly from SVN.
For your example:
Develop on the IDE as you would normally, then, when you're ready to test, check in to your local repository. Your development webserver can then have that directory checked out and you can easily test.
Once you're ready for production, merge the change into the production branch, and do an svn update on the production webserver.
Where I work some folks like to use the FileSync Plugin for Eclipse for this purpose, though I have seen some oddities with that plugin where files in the target directory occasionally go missing. The whole structure is:
Ant task to create target directory at desired location (via copy commands, mostly)
FileSync Plugin configured to keep files in sync between development location and target location as you code (sync the Eclipse output folder to a location in the Web server's classpath, etc.)
Of course, symlinks may work better on systems that have good support for symlinks :-)
To me, adding a symlink pointing to your development folder seems like a tidy solution to the problem.
If the main project is on a different machine/webserver, you could use something like sshfs to mount your development directory into the right place on the webserver.