...ObjectInUse: ERROR: database "foo_development" is being accessed by other users DETAIL: There is 1 other session using the database. This could be the rails server, rubymine and many more...
...session connection manually you can also find out the pid and kill the process. 1. rails db 2. SELECT * FROM pg_stat_activity; datid | 98359 datname | foo_development
lines = [] File.open(cucumber_paths, 'r').each do |line| lines << line.slice(/\s+when /^?([^$]*)$?/[im]?$/, 1) # @param 1: return first matched group end paths = lines.compact.sort TextMate::UI.complete(paths, :extra_chars => " ")
...Sidekiq is running @reboot start_sidekiq 23 8 * * * baz 30 * * * * plop 5 8 * * * bar 1 0 * * * foo # End Whenever generated tasks for: project100 While you can human-parse this one...
Output for the example above will be: @reboot start_sidekiq 30 * * * * plop 1 0 * * * foo 5 8 * * * bar 23 8 * * * baz If you want to sort by day...
...That means the following code in routes.rb … resources :users do resource :profile, controller: 'users/profiles' #[1] end … makes Rails expect the following directory structure: app/ controllers/ users/ profiles_controller.rb users_controller.rb ... views/
show.html.haml index.html.haml ... Note: the user profiles controller must be named Users::ProfilesController [1] specifying the controller as 'user/...' would make Rails expect views in view/user/... (singular) The better approache...
Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if that is your setup. The rspec-rails gem has a...
...x, which only supports Rails 3. There is no fix for the rspec-rails-1.3.x series of the gem which supports Rails 2. Anyway, here are upgrade instructions if...
...see any changes in your debugged gem. Howto Disable spring with export DISABLE_SPRING=1 in your terminal. That will keep Spring at bay in that terminal session.
# Spring leads to all kinds of unexpected behavior in tests. ENV['DISABLE_SPRING'] = '1' block.call end
If you're experiencing problems with your Google Chrome installation after an update, it might help downgrading Chrome to check...
...and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/ $ cat ./docker-compose.yml
...remove docker-compose. Check your docker-compose version $ docker-compose --version docker-compose version 1.17.1, build unknown $ docker-compose version docker-compose version 1.17.1, build unknown docker-py version...
...that undoes the old changes. Imagine the following commit history: * commit_sha3 [Story-ID 1] Fixup for my feature * commit_sha2 [Story-ID 5] Other feature * commit_sha1 [Story-ID...
You can revert a single commit using the following syntax: git revert commit_sha2 To revert changes that are split across multiple commits, use the --no-commit...
If you open a pop-up window [1] in your Selenium tests and you want to close it, you can do this: # Find our target window handle = page.driver.find_window("My...
...any subsequent steps will break when you are not pointing to a correct window. [1] as in: a real browser window, maybe via window.open in JavaScript
...file called test.file. You would then run this: dd if=/dev/zero of=test.file bs=1048576 count=23 The block size (bs) is set to 1 MB (1024^2 bytes) here...
mb = 23 mb_string, _error_str, _status = Open3.capture3('dd if=/dev/zero bs=1048576 count=1') tempfile = Tempfile.open('some_file.txt') do |file| mb.times { file.write(mb_string) } file end
...record a h264 encoded video. record command when using ffmpeg (for e.g. with ubuntu 12.04) cat some_acces.log | logstalgia --sync -1920x1080 --output-ppm-stream - | ffmpeg -y -r 60 -f image2pipe...
...vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 logstalgia.mp4 record command when using avconv(for e.g. with ubuntu 14.04) cat some_acces.log | logstalgia...
...to pass the desired format as a String, not a Symbol: get :show, :id => 1, :format => 'pdf' # works get :show, :id => 1, :format => :pdf # does not work
it 'does something' do pending end it 'does something else' do pending expect(1).to eq(1) end The first case may be unexpected, if you just wanted to...
SSHKit 1.9.0 might fail with the following error, when trying to deploy a Rail application. Upgrading the gem to version 1.21.0 fixed the issue. Traceback (most recent call last):
...from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 16: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `run' 15: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec' 14: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/capistrano-3.14.1/lib/capistrano/tasks/deploy.rake:89:in `block (4 levels...
...it properly or you will "randomly" get errors like these: wrong number of arguments (1 for 0) (ArgumentError) wrong number of arguments (0 for 1) (ArgumentError) Take a look at...
def tp(objects, *method_names) terminal_width = `tput cols`.to_i cols = objects.count + 1 # Label column col_width = (terminal_width / cols) - 1 # Column spacing Array(method_names).map do...
...cells.map{ |cell| cell.to_s.ljust(col_width) }.join ' ' end nil end Usage examples: tp Video.where(key: '123'), :created_at, :updated_at, :published tp [album1, album2], :title, :image_count
...ve forked it so it works for Rails 2.3.x applications running on Ruby 1.9. [1] makandra/mongomapper is based on the "official" rails2 branch [2] which contains commits that were...
...added after 0.8.6 was released. Tests are fully passing on our fork for Ruby 1.8.7, REE, and Ruby 1.9.3. To use it, add this to your Gemfile: gem 'mongo_mapper...
I had this error: > gem install bundler Successfully installed bundler-2.0.1 1 gem installed > bundle install Traceback (most recent call last): 2: from /home/henning/.rbenv/versions/2.5.1/bin/bundle:23:in ` ' 1: from /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb...
...Probably missing gem: ' + gem_name print 'Auto-install it? [yN] ' gets.strip =~ /y/i or exit(1) system(install_command) or exit(1) # retry Gem.clear_paths puts 'Trying again ...' require gem_name...
...By default, output is sorted by directory name, not size: du -h --max-depth=1 . 40K ./a 2.3G ./b 3.1M ./c 500M ./d 2.8G .
...h switch does the magic of understanding humanized size formats): du -h --max-depth=1 . | sort -h 40K ./a 3.1M ./c 500M ./d 2.3G ./b 2.8G .
A haml angular 1 template with .thing(class="is-{{:: item.type }}") will be compiled (by haml) to which is not what you want! It will also crash in angular (unless thing...
...with Error: [$parse:syntax] Syntax Error: Token 'thing' is an unexpected token at column 11 of the expression [item.type thing] Solution 1: Use ng-class instead of class
...linked article shows what current browsers do when you click a link like this: 1-562-867-5309 Spoiler: The current state is sad It's still the case that...
...code with Bundler versions < 2.0.2. It just looks like the task is frozen: Workaround 1: Just type your OTP code and hit enter, your gem is released afterwards.
If you need to release a gem with a legacy Ruby version like 1.8.7, the workarounds above won't work for you. In this case, switch to a modern...