Create an installer for a Rails JRuby app - ruby-on-rails-3

I have a Ruby On Rails 3 app that is installed under a Tomcat in Windows XP. I used jruby and warbler to create the war file.
I need to make an installer (Which means getting the code from a git repository, configuring, executing warbler, configure warbler and copy the output to Tomcat.
Can you help me with that? What is the correct approach for this requirement? A batch file and a EXE that executes it?

Simple question: You really have to use Tomcat under Windows?
This question because with Torquebox you could solve your problem in a super simple way. All rake tasks for deploying are there, you could deploy as a war or exploded folder. Otherwise you could use Stompbox to deploy the Heroku style with git.
Look at the documentation for more details: http://torquebox.org/documentation/current/deployment.html

Related

Travis config for deploying a static site without any build actions

I'd like to use Travis to push a static HTML/JavaScript website to an Amazon S3 bucket on each commit to master. Is there any way to configure my .travis.yml so it doesn't try to run any sort of build process? Just a deploy?
It seems like this is mainly controlled by the language setting which defaults to Ruby, so Ruby is being (unnecessarily) installed on each build.
I don't know how the ruby box works (I use the java box for my work); that being said, I think that the travis CI boxes have their base language already installed so you aren't really unnecessarily installing ruby each time.
If you want, there supposedly is an undocumented option language: generic.
This way you can just run the required bash commands to deploy your code to Amazon S3

Install Redmine 3.x on WHM/Cpanel

Guys I've spent last 24 hours continuously trying to install Redmine 3.x on the WHM/Cpanel server but failed to do so. Can some please guide me with one proper way or tell me about a relatively new article regarding this issue because every solution i find on the internet is old.
There is no out-of the box solution for Cpanel.
Redmine is complex Ruby on Rails based web application, and as such it relies on lot's of 3rd party libraries, defined in Gemfile.
Although it migth be possible to install all Gems manually via Cpanel and avoid bundle install command, you would still need to run some commands like
bundle exec rake generate_secret_token
bundle exec rake db:migrate RAILS_ENV=production
So to install it via WHM/Cpanel, I suggest you create a cpanel account for your Redmine, then enable SSH access for that Cpanel user, and follow official installation tutorial from Redmine. (Which is too big to write here inside answer).
Just make sure to unpack your Redmine outside public_html!
And you can deploy your Redmine via Cpanel as FastCGI, by pointing your application path to Redmine's public directory, just make sure to have dispatch.fcgi in your public folder of Redmine
mv dispatch.fcgi.example dispatch.fcgi
mv htaccess.fcgi.example .htaccess

problems deploying openMRS.war to glassfish v.2

I'm trying to deploy openMRS v.1.9.2 to a local VM running CentOS & Glassfish 2 for work. Unfortunately, I could not get it to work. Normally, I just download the standalone found at source forge. I just double-click the jar, and I'm good to go.
I normally just SSH into the the VM, so I first tried doing everything through a terminal. Here are the steps I took:
Using wget, retrieve the .zip
Create a dir (I just called it /openmrs), cd into the new directory, and then expand the .zip.
cd into the directory.
At this point, there are two options to start openMRS.
Run the bash script: ./run-on-linux.sh
Run the .JAR: java -jar [insert_jar_name].jar -commandline
When I run the .JAR, I get a stack trace.
When I try to run the bash script, I get another error.
Anyways, I thought I found a potential solution in an openMRS JIRA ticket, but it seems aimed at Glassfish 3, and not Glassfish 2 (which is what I need to use).
I then tried deploying the .WAR via the Glassfish admin UI. I thought it would work, but after going through the steps of selecting a language, whether or not to use demo data, etc. I received this.
Does anyone have experience deploying openMRS to Glassfish 2.1.1? Unfortunately Glassfish 3 doesn't seem to be a realistic option. I would really appreciate any help here. Thanks.
Although it doesn't solve my problem of not being able to successfully deploy openMRS to an instance of Glassfish v.2, I did manage to get myself further by just installing MySQL on the VM. Our work machines are all set up for postgres, so I think should have guessed earlier that not having a MySQL server installation was the problem.
Here is a tutorial I used to install MySQL

Building .war with JRuby and warbler

I have been trying for hours to get a JRuby Rails application packaged as a war that actually works, without success... (JRuby 1.6.7, warbler 1.3.5, Rails 3.2.2)
Issue #1: Warbler seems to like to lump all libraries in one root folder rather than respecting the subdirectories they originally came from. For example, the Rails app itself runs fine but the war is broken when libraries are referenced as
require "lib/foo/bar.jar"
require "lib/baz.rb"
Mind you, foo/bar.jar and baz.rb are actually present in WEB-INF/lib, I just don't know how to configure Warbler to wire things up so the requires work right.
Issue #2: If I condescend to change all the requires to
require "bar.jar"
require "baz.rb"
, all is well if I build an executable war file, but if I try dropping the war into a Tomcat 6.0.20 installation, the application fails to initialize:
SEVERE: Error: application initialization failed
java.lang.NullPointerException
at org.jruby.RubyInstanceConfig$ArgumentProcessor.processArguments(RubyInstanceConfig.java:711)
No amount of Googling has shed light on what the problem is. Presumably the war is missing something or misconfigured somehow, but what is it?
I can't say for sure this would cause your error - however I remember that there was a known bug between Jruby and Rails 3.2.x - which was apparently fixed in Jruby 1.7.
I had tried using Rails 3.2 with Jruby 1.6.7 before and came across this:
JIRA-Ticket-JRUBY-3986
Hope that may at least help a little

Can't uninstall GlassFish 3

Okay, so here is the deal:
I was trying to install the java jdk so i can work on an android project in eclipse on this computer, but there are just so many different installations of java its impossible, for me atleast, to figure out exactly which one i needed. so i went with "JDK 7u3 with Java EE". But this also installed this GlassFish stuff, which i have no idea what is or what it does, and when i was going through all the eclipse stuff i decided to just keep my other computer for work. so i removed eclipsed and the stuff needed for that, and i removed the java stuff, but then when i try to uninstall the GlassFish, it can't, and gives me the error:
"Could not find the required version of the Java(TM) 2 Runtime Environment in '(null)'."
I have now been trying for several hours, scouring the web to figure out some way of removing this, install all kinds of java stuff, removing it again, reinstalling, but nothing works. I don't really care what GlassFish is or what it does, i just want it, and all the java stuff gone for good.
How can i accomplish this?
under Microsoft Windows 7 (or others), use that command line :
uninstall.exe -j "%JAVA_HOME%"
You installed first jdk1.6 then uninstalled it. In this time, you install glassfish3 and glassfish wrote set AS_JAVA=C:\Program Files (x86)\Java\jdk1.6.0_x in its config file but you use now jdk1.7
Open C:\glassfishv3\glassfish\config\asenv.bat
Search 'set AS_JAVA'
Change its value to your current jdk path ( eg. C:\Progra¨1\Java\jdk1.7.xx )
Try to uninstall again.
You can run the uninstall specifying the jvm to use:
try this following command to uninstall
C:\glassfish3\uninstall.exe -j <java home dir>
as stated in the error message. it worked for me.
GlassFish is a Java EE application server developed in open source, so you can create server-side services that your android apps can consume. Of course, is sounds like you are not really interested in this :-)
The Java EE SDK install/uninstall instructions are here: http://java.sun.com/javaee/sdk/javaee6sdk_install.jsp
What you probably want to download, the Java 7 SDK (JDK 7) is here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Make sure you download the JDK (Java Developer Kit) and not the JRE (Java Runtime Environment).
Hope this helps.
These didn't work for me running java 1.6.0_24 in Windows 7:
I tried modifying the asenv.bat file that glassfish uses to find the jre to point to my jre.
I tried manually putting it in as in C:\glassfish3\uninstall.exe -j . This was per the official Oracle documentation.
The only thing that worked was to use the original path and move the bin and lib folders from my java installation to the directory that the error dialog
specified. Then the Glassfish uninstall started up and completed with no problems.
I was able to uninstall the glasshfish server by using the below command
uninstall.exe -javahome "%JAVA_HOME%"
Note: We need to set the JAVA_HOME in the environment variable and classpath variable