PG::ConnectionBad: could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deploy to scalingo | |
# example : rake deploy REMOTE=staging | |
# last version available here : https://gist.github.com/dlupu/cdd6e1507c8cc3c7c617 | |
namespace :deploy do | |
task :detect_app do | |
SCALINGO_REPOSITORY_REGEXP = /\[email protected]:(?<app_name>.*)\.git\z/ | |
remote_name = ENV['REMOTE'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method': undefined method `attributes_for' for class `Devise::ParameterSanitizer' (NameError) | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method_chain' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/parameter_sanitizer.rb:12:in `included' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `include' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `block in <class:Engine>' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/lazy_load_hooks.rb:36:in `call' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method': undefined method `attributes_for' for class `Devise::ParameterSanitizer' (NameError) | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method_chain' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/parameter_sanitizer.rb:12:in `included' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `include' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `block in <class:Engine>' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/lazy_load_hooks.rb:36:in `call' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method': undefined method `attributes_for' for class `Devise::ParameterSanitizer' (NameError) | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method_chain' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/parameter_sanitizer.rb:12:in `included' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `include' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `block in <class:Engine>' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/lazy_load_hooks.rb:36:in `call' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method': undefined method `attributes_for' for class `Devise::ParameterSanitizer' (NameError) | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/module/aliasing.rb:37:in `alias_method_chain' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/parameter_sanitizer.rb:12:in `included' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `include' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/devise_invitable-5c4260faf54a/lib/devise_invitable/rails.rb:20:in `block in <class:Engine>' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.beta1/lib/active_support/lazy_load_hooks.rb:36:in `call' | |
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesuppo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionView::Template::Error: private method `routes' called for #<ActionDispatch::Routing::RouteSet::NamedRouteCollection:0x007fde7a5e4498> | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/js-routes-1.2.0/lib/js_routes.rb:62:in `generate' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/js-routes-1.2.0/app/assets/javascripts/js-routes.js.erb:2:in `_evaluate_template' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/lib/sprockets/erb_processor.rb:26:in `call' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/lib/sprockets/erb_processor.rb:13:in `call' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:75:in `call_processor' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `reverse_each' | |
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sprockets-3.5.2/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### THIS SCRIPT IS EXECUTED IN THE APP ROOT FOLDER ### | |
# be sure scalingo.com is a known ssh host 00:00 | |
ssh-keyscan -H -p 22 scalingo.com >> ~/.ssh/known_hosts | |
# install Scalingo CLO | |
curl -O https://cli-dl.scalingo.io/install && bash install | |
# DPL is a deploy tool made for continuous deployment (ruby) | |
gem install dpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'english' | |
require 'rubocop' | |
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze | |
changed_files = `git status --porcelain`.split(/\n/). | |
select { |file_name_with_status| | |
file_name_with_status =~ ADDED_OR_MODIFIED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/products_controller.rb | |
class ProductsController < Spree::ProductsController | |
helper Spree::Api::ApiHelpers | |
def index | |
@searcher = build_searcher(params.merge(include_images: true)) | |
@products = @searcher.retrieve_products | |
json = Rabl.render(nil, 'spree/api/products/index.v1', { |
OlderNewer