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?

Question:

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
   Location.reindex
 end
...
end

My app/models/location.rb looks like this

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

My app/models/search.rb looks like this

class Search < ActiveRecord::Base
   ...
   def self.location_auto_complete(search_term)
     location_ids = Organization.locations.map(&:id)
     Location.search(search_term, fields: [{location_name: :word_start}, :from, :search_id], where: {id: location_ids}) 
   end
end

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')
   @location.reindex
   Location.searchkick_index.refresh
  end
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)
end

end

My /myapp/config/circle.yml looks like this i followed : https://circleci.com/docs/installing-elasticsearch :

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

dependencies:
  post:
     - wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz
     - tar -xvf elasticsearch-1.0.1.tar.gz
     - elasticsearch-1.0.1/bin/elasticsearch: {background: true}

 dependencies:
    cache_directories:
     - elasticsearch-1.0.1 # relative to the build directory
    post:
     - if [[ ! -e elasticsearch-1.0.1 ]]; then wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz && 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.

Answer:

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


Related:


can I display asciidoc document in github?


github,asciidoc
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 clone a public GitHub repository recursively without authentication?


git,github
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...

git add file to archive


git,github,gitignore,gitattributes
When I run this command, the files of my latest commit are saved to a ZIP. git archive -o ../code_version0.9.zip 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...

Cross-Domain iFrame Tracking with Google Analytics


html,ruby-on-rails,ruby-on-rails-3,iframe,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 segment.io. The tracking script is in the head section of the container page. We have no affiliation with the 3rd party...

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


git,github,git-tag
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 ?...

.gitignore File Not Working With Bonobo


git,visual-studio,github,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...

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


git,github,git-branch
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?

Devise nested attributes form field not showing


ruby-on-rails,ruby,forms,ruby-on-rails-3,devise
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...

git branch - local or what?


git,github
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...

Custom Search in Ruby on Rails


mysql,ruby-on-rails,ruby,ruby-on-rails-3
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,...

Heroku RAM not increasing with upgraded dynos


ruby-on-rails,ruby,ruby-on-rails-3,memory,heroku
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...

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


git,github,command-line,software-distribution
I found this at github https://github.com/blog/1547-release-your-software. 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...

ApplicationController helper method undefined in Rails


ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4
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...

Advantages/disadvantages to branches and forks


git,github,git-branch,git-fork
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...

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


windows,git,powershell,github,github-for-windows
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...

Messed up a merge when trying to upgrade my Laravel application


git,laravel,github,merge
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...

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


github
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?...

Linking to another html page on Github


html,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 to use Library from GitHub in android App


android,github,gradle,libraries
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...

choose authentication for git pull


git,github
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...

Managing git repos


git,github
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,...

How to point branch to master after rebase complete


git,github
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 https://github.com/myadmin/testrepo.git git...

See previous commit in Github


git,github
After searching my git log for an old commit, I take its full hash paste it into my browser as https://github.com/my_repo/commit/hash 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....

Contributing to open source project on github


git,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...

whenever gem not working, Rails 4


ruby-on-rails,ruby,ruby-on-rails-3,cron,whenever
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"...

Github: forking loop


git,github,forking
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


ruby-on-rails,ruby,ruby-on-rails-3,activerecord
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...

Why doesn't “go get gopkg.in/…” work while “go get github.com/…” OK?


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

how to update my github library with an existing fork?


github
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? ...

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


git,github,git-commit,git-add,git-init
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....

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


html,css,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...

How to pull files and only override conflicts


git,github
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...

Creating a object with nested form rails


ruby,ruby-on-rails-3,ruby-on-rails-4,nested-forms
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...

Associate git repo with existing fork network


git,github,git-fork
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...

Link to download latest version tag of a repository from GitHub


github,github-api
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,...

git fork from certain tag version - requirements.txt


django,git,github
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...

Get list of changed files from remote server git


git,svn,github
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.

Twitter Boostrap in Rails


ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,twitter-bootstrap-3,rubygems
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...

How to push local git repo to remote branch?


git,github
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...

Git submodule fail because of link to unexisting revision


git,github,git-submodules
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...

Pull request within one project/branch?


git,github
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...

Keep config file secure using github and Elastic Beanstalk?


amazon-web-services,github,passwords,config,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...

Trying to understand git upstream branch


git,github,version-control
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...

How to deal with forked gems and bundle


ruby-on-rails,git,github,gem,bundler
I've forked a gem and it is hosted on Github. Then, in Gemfile this is what I've got: gem 'mongoid-scroll', git: 'https://github.com/bgvo/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...

Deploy closed source aar maven repo to github


android,git,maven,github,gradle
I am using the following guide to publish a closed source aar as maven repo on github: http://andydyer.org/blog/2014/10/05/hosting-android-dependencies-on-github/ The github repo I am publishing to: https://github.com/tabishfayyaz/test-sdk In my gradle.build file I have: repositories { maven { url "https://github.com/tabishfayyaz/test-sdk/blob/master" } } dependencies { compile 'com.adscendmedia.sdk:adscendmedia:1.0.1' } However Android studio results in...

Rails - How to find tilt version?


ruby-on-rails-3,ruby-on-rails-4,sprockets,tilt
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...

Print variables coming to model's methods


ruby-on-rails,ruby,ruby-on-rails-3,console
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 create a paypal form display in github README


github,markdown
What I am trying to do is, Display the paypal donation form into github project README.md 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 ?...

Fix git branch after another developer did a reset


git,github
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...

Sum returns value when should return 0


ruby-on-rails,ruby-on-rails-3
I'm having a really confusing problem. Here it is: [12] pry(EstimatedTime)> EstimatedTime.where(user_id: User.current.id, plan_on: date).pluck(:hours) => [] [13] pry(EstimatedTime)> EstimatedTime.where(user_id: User.current.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...