ruby-on-rails-3,github,rspec,elasticsearch,circleci , Cannot run elastic search in circleci to make my rspec for elasticsearch to pass?

Cannot run elastic search in circleci to make my rspec for elasticsearch to pass?


Tag: ruby-on-rails-3,github,rspec,elasticsearch,circleci

i have configured my project in github with circleci. I am using searchkick for elastic search. my code to reindex looks like this:

IN spec_helper.rb
RSpec.configure do |config|
 config.before :each do

My app/models/location.rb looks like this

class Location < ActiveRecord::Base
   searchkick word_start: [:location_name], autocomplete: [:location_name]

My app/models/search.rb looks like this

class Search < ActiveRecord::Base
   def self.location_auto_complete(search_term)
     location_ids =, fields: [{location_name: :word_start}, :from, :search_id], where: {id: location_ids}) 

My /spec/models/search_spec.rb looks like this

 require 'rails_helper'
 describe Search, type: :model do
  before :each do

   @location = create(:location,location_name: 'kathmandu')
describe '.location_auto_complete(search_term)' do
it 'return location search result for the location search term' do
   expect(Search.location_auto_complete('kathmandu')).to match_array(@location)


My /myapp/config/circle.yml looks like this i followed : :

# replace CircleCI's generated database.yml
- cp config/ config/database.yml
- bundle exec rake db:drop db:create db:migrate
   - elasticsearch

     - wget
     - tar -xvf elasticsearch-1.0.1.tar.gz
     - elasticsearch-1.0.1/bin/elasticsearch: {background: true}

     - elasticsearch-1.0.1 # relative to the build directory
     - if [[ ! -e elasticsearch-1.0.1 ]]; then wget && tar -xvf elasticsearch-1.0.1.tar.gz; fi
   - elasticsearch-1.0.1/bin/elasticsearch: {background: true}

When i run rspec in my laptop it works fine while i push to github(which is integrated with circleci)i, status is failed. It also says:

 We didn't find a circle.yml for this build. You can specify deployment or override our inferred test steps from a circle.yml checked in to your repo's root directory.More information in our docs.


The error message says circle.yml should be in the repo's root directory, but you have it the config directory.


Managing git repos

I am new to git and am unsure of a few things, would really appreciate if someone could answer the below questions. So I own 2 private git repos. Repo1 has numerous developers contributing. Repo2 is only for me. I want to be able to basically take a copy Repo1,...

Trying to understand git upstream branch

I have a git project. The remote only have a master branch, at local I have a master and proj-structure branch. I created the proj-structure branch using 'git branch -b proj-structure'. I am currently at proj-structure branch at local, when I try to git push, the git suggests me to...

Advantages/disadvantages to branches and forks

I am currently working on a project via a fork of the main repo. I am committing my changes to <fork>/master and then submitting pull requests to <upstream>/master. I have write permission for <upstream>. Am I correct in thinking that I could make this simpler by deleting my fork and...

How to push local git repo to remote branch?

I have got new design project in localhost and I have gotten github account with old design. I want to upload it to new branch. I create new branch with web interface on the github "new-design". I create local git repo: #git init I add the remote repo: #git remote...

whenever gem not working, Rails 4

I am using Whenever gem to schedule some work on my site. Currently I am working on development environment. I have instaled gem as guide suggests. In schedule.rb every 2.minutes do rake "vip_recomend:give" end In lib/tasks/vip_recomend.rake namespace :vip_recomend do desc "Give vip recomend to ads that are in waiting list"...

Messed up a merge when trying to upgrade my Laravel application

I have an existing laravel project which used an older version of Laravel 5.1. I wanted to upgrade my project to use Laravel 5.1.2. I followed this tutorial. So I added the laravel/laravel github repository into my git project as a remote called laravel, fetched it, then I created a...

Fix git branch after another developer did a reset

We 2 developers are working on a branch. I did 2 commits, and pushed them, and we later decided we didn't want them anymore. I did git reset -i <sha> to the sha before the 2 commits, and then force pushed it to the branch on github. The other developer...

can I display asciidoc document in github?

Am I able to display an asciidoc file on github in the same way that I can currently view a markdown file? According to this blog entry, I should be able to do this: If you’re interested in using AsciiDoc, head over to GitHub and create a new file in...

How to release binaries on Github for different plattforms as seperate downloads?

I found this at github Their page provide a way to attach binaries to a special release. My build script compiles binaries for Windows MacOS and Linux. How to supply seperate downloads for different platforms there? AS far I can see these releases are simple git tags. Is it...

How to use Library from GitHub in android App

I downloaded this library to use in my app, however, I can't get Android Studio to do the gradle build now. Anytime I try, I get "error:configuration with name 'default' not found". I've tried several other StackOverflow answers, but I still can't compile. My dependencies (from build.gradle Module: app) dependencies...

How to deal with forked gems and bundle

I've forked a gem and it is hosted on Github. Then, in Gemfile this is what I've got: gem 'mongoid-scroll', git: '' Whenever I make changes to the gem using Pry gem-opem command, changes are saved under the following directory: /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/ruby/2.1.0/bundler/gems/ Some things confuse me: 1) In this directory there...

Keep config file secure using github and Elastic Beanstalk?

I am using github (public) to keep track of my web app and about to deploy it to Elastic Beanstalk. Is there a good way to keep my config file secure which has RDS username/password? I have to add the file to git in order to push it to Elastic...

Where is git command after installing “GitHub for Windows”? [closed]

After installing GitHub for Windows, I can use git command in Powershell directly: C:\Users\xiaona\Documents\GitHub> git usage: git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] The most commonly used git commands are: add Add file contents to the index bisect...

Get list of changed files from remote server git

Is there a hook that gives the file name as soon as someone commits their change and merges with master from remote server? . I basically want to get a trigger that someone has updated a file on remote repo. Details like what file has been changed.

Cross-Domain iFrame Tracking with Google Analytics

I have a site (rails 3.2) that displays 3rd party news articles within an iframe. One page contains one iframe. I have Google Analytics setup. For this I use The tracking script is in the head section of the container page. We have no affiliation with the 3rd party...

.gitignore File Not Working With Bonobo

I set up a Bonobo Git server in IIS and have it working on my local computer. However, the .gitignore file is not working. I'm using the GitHub Windows client and this ignore file. I want the bin and obj folders ignored, but they are showing up as changed folders...

Print variables coming to model's methods

Having following code: class MyModel < ActiveRecord::Base before_create :do_process def do_process #I want to print here everything that came to this method self.my_stuff = my_stuff end Say we have model with name and description attributes and I'm going into console and enter something like MyModel.create! name: 'test', description: 'test' So...

How to pull files and only override conflicts

How can I pull down a git and have it overwrite my local project ONLY where conflicts are found? E.g. I have many folders / files in my local project that are not on the git project and never will be. Ok... here is the full scenario. I used DaftMonk...

How to include a commit in a tag after the tag was already created

I had tagged my branch for release and then another commit was made that needs to be included in the tag. How can I do that ? What are the steps? Can someone explain please ?...

Deploy closed source aar maven repo to github

I am using the following guide to publish a closed source aar as maven repo on github: The github repo I am publishing to: In my file I have: repositories { maven { url "" } } dependencies { compile 'com.adscendmedia.sdk:adscendmedia:1.0.1' } However Android studio results in...

Creating a object with nested form rails

I have 3 tables: members, meetings, meeting_has_members. The models are: member.rb class Member < ActiveRecord::Base has_many :meeting_has_members has_many :meetings, through: :meeting_has_members accepts_nested_attributes_for :meeting_has_members accepts_nested_attributes_for :meetings meeting.rb class Meeting < ActiveRecord::Base has_many :meeting_has_members has_many :members, through: :meeting_has_members accepts_nested_attributes_for :meeting_has_members accepts_nested_attributes_for :members meeting_has_member.rb class...

See previous commit in Github

After searching my git log for an old commit, I take its full hash paste it into my browser as and so I can see that commit in Github. Now I want to see the previous commit in Github, but I can't find a way to navigate into it....

How to create a paypal form display in github README

What I am trying to do is, Display the paypal donation form into github project file Using the html markdown display it as html rather than rendering the button with form. HTML // here goes the html of the paypal form any thoughts ?...

git add file to archive

When I run this command, the files of my latest commit are saved to a ZIP. git archive -o ../ HEAD However the files in node_modules and build/ are missing. That Is because my .gitignore is the following one: node_modules build/ How can I ignore files, but Include them In...

How do I put my index.html in the same folder as my other .html files on github?

So I just started web development an began building my portfolio. Although most of my content is on the same page and most links redirect to different websites, I do have one link that redirects to a different page of my website. So the content changes but the navigation bar...

ApplicationController helper method undefined in Rails

I'm trying to write a simple helper method that checks if a user's email address contains a specific domain name. The method is needed in all my controllers and depends on the state of current_user, so I felt the best place to put it would be in my ApplicationController. Depending...

Associate git repo with existing fork network

Using GitHub Enterprise, I forked a private repo. I then made the upstream repo public, which broke the 'fork' relationship between the public upstream and my private personal fork (as noted here). I've now also made my copy of the repo public. As far as I can tell, I can...

Twitter Boostrap in Rails

I generated views using this command rails g bootstrap:themed Todo it generated several views for my model. I am using git and reverted the project to its former branch without the boostrap. Now, I am trying to regenerate the views but it always returns this identical app/views/manifests/index.html.erb How do I...

Custom Search in Ruby on Rails

I'm trying to implement a custom search feature in my Rails app. I have 3 tables User Company and CompanyUser My relations declared are as follows class CompanyUser < ActiveRecord::Base belongs_to :company belongs_to :user ... end In Company.rb has_many :company_users, dependent: :destroy has_many :users, through: :company_users In User.rb has_many :company_users,...

How to clone a public GitHub repository recursively without authentication?

I am trying to deploy an application from GitHub into a test server. I have created a new user in the server to own the local repository and run the application. Later on this user should also perform a daily pull from the repository automatically. I am able to run...

Contributing to open source project on github

I want to add translation and a bugfix on open source project on github. I had installed git, forked the project, cloned the fork on my harddrive, changed the permissions of the file(needed to do so I can test the changes), then created a new branch called "Bulgarian_language", then added...

Sum returns value when should return 0

I'm having a really confusing problem. Here it is: [12] pry(EstimatedTime)> EstimatedTime.where(user_id:, plan_on: date).pluck(:hours) => [] [13] pry(EstimatedTime)> EstimatedTime.where(user_id:, plan_on: date).sum(:hours) => 3.0 What kind of magic is this? This statement resides in model method, that is being called from view. Before that, in controller action, i'm calling...

Link to download latest version tag of a repository from GitHub

I want to make download link for latest version of my application from GitHub tags. But I can not use GitHub releases, only just tags to make the new version. So I want an universal link to the latest tag zipball. I already did that with jQuery and GitHub API,...

Why doesn't “go get…” work while “go get…” OK?

I try to use go get to install pool according to, but can't success: C:\Users\xiaona\Documents\GitHub> go get -v Fetching https fetch failed. Fetching import "": http/https fetch: Get l.v2?go-get=1: dial tcp ConnectEx tcp: A connection attempt failed because the connected party did not...

Github: forking loop

I'm still very new to coding and Github and as such am a little confused with how forking repos works - so please forgive what may be a basic question. I've been working on a project with different pair partners all week and my current code base situation is as...

has_and_belongs_to_many loads wrong resource

I have 3 models # generic one class Someone < ActiveRecord::Base end # customer class Customer < Someone has_and_belongs_to_many :groups, join_table: "some_join_table", class_name: "Group" end # custom group class Group < GenericGroup has_and_belongs_to_many :customers, join_table: 'some_join_table', class_name: "Customer" end Let's assume that database is feeded. When i execute command Customer.first.groups...

Linking to another html page on Github

I've tried to search for a solution to this but wasn't quite sure how to phrase my problem in google in a concise way to obtain a solution. I'm rather new to Html and git hub and recently I made my own Github page with my own html code. In...

How is a branch different from a folder, in a GitHub repository?

I'm new to GitHub, and I don't exactly understand what a branch is. I got a feeling it is like a folder. Please explain: what exactly is the difference between folder and a branch?

git branch - local or what?

I ran the following commands: (we have a staging branch called "master_next") (1) git fetch origin (2) git checkout -b origin/master_next now, when I run (3) git branch I see some weird stuff. Instead of seeing master master_next I see master origin/master_next why is the branch I just checked out...

Git submodule fail because of link to unexisting revision

I've got a problem with git submodules pull: I have two reporistories, let's call them repo A and repo B. Repo B is a submodule of repo A, so I added repo B as a submodule of A with this command line: git submodule add [email protected]:Aracthor/B.git libvvgl But when I...

Can git ever send your code to a repo that isn't yours?

Can running git add . git commit -m "message" in a git repo which you've initialized using git init ever result in your code being sent to a repo that is not yours? I am concerned because I did this while not logged in to my git hub account....

Devise nested attributes form field not showing

I am having trouble viewing the nested attributes field in my form. I am in the jobs/new view and I want have a User form that creates a job as well as a user. I have everything in this answer Rails 4.0 with Devise. Nested attributes Unpermited parameters I have...

how to update my github library with an existing fork?

my friend forked my library and worked on it, but the old version appears on my Github page. Now can I show the new master? ...

How to quickly format programming codes in the GitHub's Issue?

If I create an issue with some codes in the gitHub, how to format it? I have to add more white spaces again and again...... Is there anything like what we can see in the StackOverFlow by clicking "Code Sample" button?...

git fork from certain tag version - requirements.txt

I want to fork one github project code, but not from master branch, but from older release. Reason: I want to edit one place in the code in my fork version and put the url of this tag version into my requirements.txt so that pip install -e git+https://git_url_to_my_form_in_this_tag_version works. I...

Pull request within one project/branch?

Suppose C(=Coder) and S(=Supervisor) are working on a project. For some reasons S never contributes to the codes and just comments on the code. Instead C is the only person coding. Is it possible to send pull request by C to be reviewed by S, within one project, or they...

How to point branch to master after rebase complete

I am not very much clear about git rebase workflow, I try my self to rebase two different branches as mention below. But I am not able to update my branch to where master is pointing after rebase completed. Below are the steps which I performed git clone git...

choose authentication for git pull

I want to add a second form of authentication to a github remote. Here is the situation : I have ssh access to a shared server In the server, there is a git repository, with a github remote. If I run git pull, it asks for a passphrase that I...

Rails - How to find tilt version?

Gem tilt is used with sprockets for Rails assets precompile. We are having hard time to find the version running on our Rails 4 app as tilt --version returns version unknown: $ tilt --version tilt: version unknown tilt --help give no info about how to find version. Is there way...

Heroku RAM not increasing with upgraded dynos

I have a massive function i have been calling manually through the heroku rails console. I have been receiving the error rapid fire in my logs: 2015-06-22T14:56:42.940517+00:00 heroku[run.9877]: Process running mem=575M(112.4%) 2015-06-22T14:56:42.940517+00:00 heroku[run.9877]: Error R14 (Memory quota exceeded) A 1X dyno is suppose to have 512 MB of RAM. I...