The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline configuration for Ruby on Rails?

ichai
August 27, 2016

What commans should I use to run rspec test in pipeline?

If I use documenation example:

pipelines:
default:
 - step:
script: # Modify the commands below to build and test your repository.
 - ruby --version
- bundler --version
- bundle install

I have an error: + + ruby --version bash: ruby: command not foundruby --version bash: ruby: command not found

+ ruby --version bash: ruby: command not found

by: command not fMound

 Maybe there is more working example?

Thanks.

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2016

The issue here is that you're not using an image with the required dependencies for your project.

There are a few ways you could approach this.

The first is to run a command as part of your build that downloads the dependencies using apt-get (or another appropriate package manager).

The other option is to build your own docker image (either from scratch or by extending the existing ruby image), publish it to dockerhub and then use the image you pushed. Documentation for this can be found here https://docs.docker.com/engine/tutorials/dockerimages/

0 votes
ichai
August 27, 2016

Now rails need JS runtime. 

+ bundle exec rspec
bundler: failed to load command: rspec (/usr/local/bundle/bin/rspec)
Bundler::GemRequireError: There was an error while trying to load the gem 'coffee-rails'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.

Often I use nodejs localy. Could I add nodejs support? Or somehow set up js runtime?

Stefan Slaveykov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 22, 2018

Can you share how you have solved this one?

David Weber
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 6, 2018

Any resolution?

icotanchev
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2018

I just added the following to my script section and it solves the problem

apt-get update && apt-get install -y build-essential nodejs

Image already added

Like roseliux likes this
0 votes
ichai
August 27, 2016

Thanks with 'image' option ruby is working.

0 votes
Alex Soto
Contributor
August 27, 2016

Are you using the right image?

 

# You can use a Docker image from Docker Hub or your own container registry
image: ruby:2.3.1

 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events