A problem occurred starting process 'command 'jruby'' - rvm

I have a Gradle task from X-road project:
task runModelTests(dependsOn: [updateSQLiteDbSchema], type: Exec) {
commandLine = ['jruby', '-S', 'rake', 'test:units', 'RAILS_ENV=test']
}
The task is failed with following exception:
Could not start 'jruby'
Cannot run program "jruby" (in directory "/home/virtdev/IdeaProjects/X-Road/src/center-service"): error=2, No such file or directory
error=2, No such file or directory
But I have jruby -v:
warning: --1.9 ignored
jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e Eclipse OpenJ9 VM openj9-0.26.0 on 11.0.11+9 +jit [linux-x86_64]
rvm -v:
rvm 1.29.12
Ubuntu 20.04
Update:
I don't have a problem with Gradle.
The problem is jruby: No suck file or directory -- warble (LoadError) when I run jruby -S warble cmd
in /src/central-server dir.
Similar issue

I manually install warbler after that script failed with another dependency error.
In the end I completely reinstalled RVM with and it helped.

Related

Changing Ruby and Rails version with capistrano and rvm

What are the correct steps for changing the configuration of my project when change the ruby and rails version, using rmv.
For example, I have to change in deploy.rb set :rvm_ruby_version, '2.4.0#5.1', but what else?
I can't get Capistrano use the correct rvm gemset, and allways tries to bundle install with the old rvm gemset
Do I have to change something in the production server? I think so, but in some order, before deploy and then after deploy some other changes...¿?
I have tried capistrano-rvm , rvm-capistrano, and finally rvm1-capistrano3
When I run cap production depoly, I get these errors, all arround "Could not determine which Ruby to use"
DEBUG [e2eccae9] Running /home/rails/www/digitalshelving/rvm1scripts/rvm-auto.sh . bundle check --path /home/rails/www/digitalshelving/shared/bundle as rails#46.101.100.14
DEBUG [e2eccae9] Command: cd /home/rails/www/digitalshelving/releases/20180303130204 && /home/rails/www/digitalshelving/rvm1scripts/rvm-auto.sh . bundle check --path /home/rails/www/digitalshelving/shared/bundle
DEBUG [e2eccae9] Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.
DEBUG [e2eccae9] Can not find ruby for '.'.
DEBUG [e2eccae9] Finished in 0.684 seconds with exit status 103 (failed).
INFO [c22dc933] Running /home/rails/www/digitalshelving/rvm1scripts/rvm-auto.sh . bundle install --path /home/rails/www/digitalshelving/shared/bundle --without development test --deployment --quiet as rails#46.101.100.14
DEBUG [c22dc933] Command: cd /home/rails/www/digitalshelving/releases/20180303130204 && /home/rails/www/digitalshelving/rvm1scripts/rvm-auto.sh . bundle install --path /home/rails/www/digitalshelving/shared/bundle --without development test --deployment --quiet
DEBUG [c22dc933] Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.
DEBUG [c22dc933] Can not find ruby for '.'.
Thanks
In Rails.root create file with name .ruby-version and following content:
2.3.3
or whatever version you want. When you or capistrano cd to root folder rvm will change ruby version according to file's content

cap deploy:migrations fails with Could not locate Gemfile

I'm working on my first rails deployment and having a problem I can't figure out.
mac osx 10.8.2
ruby 1.8.7
Rails 3.2.6
rvm 1.17.2
I've been following this tutorial http://brandnewrails.wordpress.com/ and got stuck on 7c.
I set it all up in RVM, got git running on the server, ran bundle install in the app, and wrote the Capistrano recipe in my_app/config/deploy.rb
Then I ran:
$ capify . no problem
$ cap deploy:setup no errors
$ cap deploy:check returned You appear to have all necessary dependencies installed
$ cap deploy:migrations is where the problem happens. After successfully running a bunch of the commands, capistrano fails. See below:
2012-12-10 00:43:56 executing `bundle_install'
* executing "cd /home/{servername}/party/releases/20121209134354 && bundle install --path vendor/bundle"
servers: ["{servername}"]
[{servername}] executing command
** [out :: {servername}] Could not locate Gemfile
command finished in 694ms
failed: "sh -c 'cd /home/alexchee/party/releases/20121209134354 && bundle install --path vendor/bundle'" on {servername}
Does anyone know what to do? When I check the app directory, the Gemfile is there. Any ideas or further questions?
The inability of capistrano to locate a Gemfile in this case seems to be a symptom of not having initiated git in the app locally, that is on my own computer.
My hunch is that since Gemfile is the first file in the list above, that is why it created an error first. If the program had continued, it would have probably had other errors as well.
Even if git is running on the server and the app is bundled up correctly, you must also initiate git locally and direct it to the appropriate files on your server in order for the deploy to work.
Great instructions are listed here: http://brandnewrails.wordpress.com/2012/10/14/lesson-7b/

Capistrano & jruby & rvm - Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources

I encountered Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources during deploying my application using capistrano, and when processing deploy:assets:precompile.
The command is:
cd /opt/app/deploy/entercamp/releases/20120627132117 && /usr/local/rvm/rubies/jruby-1.6.7/bin/jruby --1.9 -S bundle exec rake RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile
I tried the command manually on the server and it works quite ok. And I could see that rake-0.9.2.2 is installed in the result output of bundle:install in the deploy process.
Where could be the problem?
Detailed information is in: https://gist.github.com/3005237
This just got fixed with help of Michal from rvm-capistrano project.
It raises this error is because jruby is install with version 1.8 by default and it tries to switch to 1.9 when deploying and that causes the problem.
The solution is to install jruby with version 1.9 by default: rvm install jruby-1.6.7.2 --1.9 and then it works.

json gem won't install on Windows

Here is the error I keep getting. I installed DevKit and followed all the instructions.
gem install json -v '1.6.3'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
"C:/Program Files/Ruby/Ruby192/bin/ruby.exe" extconf.rb
creating Makefile
make
Makefile:160: warning: overriding commands for target `C:/Program'
Makefile:153: warning: ignoring old commands for target `C:/Program'
C:/Program Files/Ruby/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_parser'" > par
ser-i386-mingw32.def
/bin/sh: C:/Program: No such file or directory
make: *** [parser-i386-mingw32.def] Error 127
Gem files will remain installed in C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3 for inspection.
Results logged to C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
Does anyone have a solution to this?
Just ran into this as well. Via Installing dm-types on Windows. (Win7 x64): this fixed it:
It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:
mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"
and then try installing with c:\ruby\bin\ruby.exe. You can delete the symlink after installing.

Maven RPM Plugin fails to find rpm command in intellij

I have a module I am trying to package as an RPM using Maven RPM plugin. When I run mvn package from the command line, it generates the rpm as expected. When I try to run the package phase from within Intellij, it seems unable to find the rpm command:
[WARNING] /bin/sh: rpm: command not found
...followed later by:
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-1:rpm (default-rpm) on project ve_hive_client: RPM query for default vendor returned: '127' executing '/bin/sh -c rpm -E '%{_host_vendor}'' -> [Help 1]
My hunch is that my rpm installation (/usr/local/bin/rpm) isn't available in Intellij's PATH. Any idea how to add it?
had the same problem on ubuntu. i just installed the rpm program and the PATH then had rpm then.
/usr/bin/rpm
Maven did not complain then
try adding:
PATH=PATH:/usr/local/bin/rpm
in your .bashrc?
Not sure if this will help or not, but worth a try.
If you are running OSX and you've installed rpm using homebrew then it's not related with paths or rpm itself.
In OSX executing
/bin/sh -c rpm -E '%{_host_vendor}'
is different than executing
/bin/sh -c "rpm -E '%{_host_vendor}'"
The latter works pretty well.
Anyone found a way to fix this without changing the plug-in's source code?