Cucumber command not found - jenkins

While executing my feature file,in the local Jenkins I am getting the below error.
cucumber: command not found
I am using cucumber feature/xyz.feature command to run the scripts
Any pointers how to proceed.

Normally, you should be able to run the cucumber executable if the setup is done correctly. Read here.
From the error it looks like cucumber is not on your path thus indicating RubyGems binary folder is not on your path. Check the path (use gem env) and update it accordingly.

Related

Module build failed: Error: spawn bin/rails ENOENT

After adding the ERB loader and adding the .erb file extension to my application pack (with webpacker), I am getting the following error:
ERROR in ./app/webpack/packs/application.js.erb
Module build failed: Error: spawn bin/rails ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
# multi (webpack)-dev-server/client?http://localhost:3035 ./app/webpack/packs/application.js.erb
it is also happening with the sample hello_erb.js.erb pack.
Here is an example app that reproduces the problem: https://github.com/jonhue/test_app
You may be missing generated files
If you are missing the bin/rails executable maybe you have cloned from a repository that followed the steps on this issue
Your enviroment should be good to go if you have rails installed correctly and then run:
Rails < 5
$ bundle exec rake rails:update:bin
Rails >= 5
$ rails app:update:bin
You may have issues with webpack installation and/or configuration
If those files on bin\ exists, you may have ran into problems when installing and/or configuring webpack.
Try creating a project installing everything following the documentation, commiting it with a versioning system like GitHub, copy/paste your project configuration and git diff it, I bet you will find differences between them.
You are using Windows or some enviroment that is problematic
If that is the case there is already a discussion to fix it in an open issue in webpacker github. But you could try stuff like using webpacker directly from github to get latest fixes, downgrading to other versions to see if the result is different, or use webpack from source and change the file install.rake that makes you call ./bin/rails app:template... to just rails app:template....
The ERB runner configuration contains a setting that must be changed for it to work on Windows. Open config\webpack\loaders\erb.js and replace this line:
runner: "bin/rails runner"
with this line:
runner: "ruby bin\\rails runner

generating WAR file for ruby on rails application

I am using Warbler to generate a WAR file for my ruby on rails application. I don't use anything special in my application, and i only run the "warble war" command.
In the WAR generation i am getting those 2 warnings
warning: skipping minitest
warning: skipping json
Upon the importing of the WAR in eclipse, the project can't be built and it says
Archive for required library: '/WebContent/WEB-INF/lib/gems-gems-warbler-1.4.1-spec-sample_war-some.jar'cannot be read or is not a valid ZIP file
I tried to follow some workarounds from https://github.com/jruby/warbler/issues/199 but without any clue. I am using Rails version 4.0.2 and warbler version 1.4.1 .I am new to deployment so i would be grateful if somebody can help me. Thanks
A better way to exclude the offending file : the warble config.
Generate the configuration with
warble config
Then uncomment the following line to fix it :
config.gem_excludes = [/^(test|spec)\//]
Let me warn you that this is a complete butcher job and I only used this because I was perplexed as to why I was also getting the same errors and Tomcat died when trying to deploy my jruby/rails application. Here's what I did:
$ ls -l /usr/local/opt/tomcat/libexec/webapps/workspace/WEB-INF/lib/*sample*
You will see some warbler sample jars there. gems-gems-warbler-1.4.1-spec-sample_war-some.jar has a size of 0. It's the problem, but I figure I don't really need any sample jars, thank you. So:
$ bundle show warbler
/PATH/.rvm/gems/jruby-1.7.10#rails4/gems/warbler-1.4.1
$ rm -rf /PATH/.rvm/gems/jruby-1.7.10#rails4/gems/warbler-1.4.1/spec/*sample*
$ bundle exec warble war
Deploy to Tomcat, and the context starts just fine. Less than ideal and probably there is a "correct" solution. This got me moving forward, tho.

Bundle command not found error in capistrano deployment

I am using capistrano deployment.
These errors i m getting after cap deploy
Command 'bundle' is available in '/usr/local/bin/bundle'
The command could not be located because '/usr/local/bin' is not included in the PATH environment variable.
bundle: command not found
Please help
It looks like you need to add the /user/local/bin folder to the path on the target system. Whatever login you are logging in as with Capistrano, find the profile that contains the path, and add it.
Or, add /usr/local/bin to the master path (the actual file depends on the operating system and version. If you provide the operating system and shell, we can tell you the file to look for)

Ruby - ExecJS not loading (I have the proper materials and PATH location.) [Windows]

I am having a problem with the ExecJS in that it is unable to locate a required Runtime. I am using Windows, and I have both Windows CScript and Node.js installed on my computer, but neither of these guys are being invoked.
As a result, I am unable to run any rails task that involves this (I cannot even load my rake list in RubyMine to call actions such as db:create to create my databases from a fresh project.)
I am capable of accessing both csript and node from the command line, and I have checked my environment variables and their proper file locations are in the PATH. There's something else ruining my ability to use ExecJS. Has anyone else had a similar experience where you have had all of the right stuff, but something is still going wrong?
When Ruby spawns child process to invoke CScript or Node, it will use the same rules that allow cmd.exe execute them from the command line.
But, sometimes, stuff in your registry or your environment variables can affect this process.
At RubyInstaller project we collected a series of troubleshooting items that could possible be the culprit.
Please check that COMSPEC environment variable is set to use cmd.exe and nothing like TCC/LE or other stuff.
C:\>SET COMSPEC
Also, check that your registry do not contain an AutoRun key, which will also affect Ruby.
C:\>REG QUERY "HKCU\Software\Microsoft\Command Processor"
C:\>REG QUERY "HKLM\Software\Microsoft\Command Processor"
If you see a key AutoRun in one of the above commands, that means something is setup to automatically execute everytime a new cmd.exe is started, which is bad for some cases.
Please follow the instructions in the Troubleshooting page on how to remove it.
This also affects gem installation that requires compilation, but if is not failing for you then the problem might be something else.
Hope that helps.
I was having similar problems, my basic skeleton app wouldn't run despite having Node.js installed, and then trying therubyracer gem. Finally I decided to use my troubleshooting mantra with windows, "When in doubt, run as admin". So I ran my rails cmd as an admin and it worked fine after that.

How to run ./script/generate rx_config?

I'm a newbie and i'm working follow this link http://dima.github.com/2009/03/19/working-with-restfulx-model-attachments.html
But I stuck on the step run ./script/generate rx_config. I don't know how can I run it.
I tried to go to the path of folder script and typed generate rx_cofig on command line but it doesn't work.
C:\Data\Workspace\rx_model_attachments\script>generate rx_config
I got the error 'generate' is not recognized as an internal or external command, operable program or batch file.
Anyone can tell me step by step of doing this. Big thanks!
Since you're on windows, you will need to preface all of the scripts in the scripts folder with ruby:
C:\Data\Workspace\rx_model_attachments\script>ruby script/generate rx_config
The usual hash-bang (#!) at the start of the script files to let the shell know which interpreter to run does not work on windows.

Resources