Skip to content

Instantly share code, notes, and snippets.

View rubyandcoffee's full-sized avatar
🐒

Alexandra Wolfe rubyandcoffee

🐒
  • Cheshire, United Kingdom
View GitHub Profile
@rubyandcoffee
rubyandcoffee / Bootstrap - Rails 7
Last active June 13, 2024 11:48
Bootstrap with Rails 7
Adding Bootstrap to Rails 7
Reference: https://www.linkedin.com/pulse/rails-7-bootstrap-52-importmap-md-habibur-rahman-habib/
INSTRUCTIONS
1. Add the following to Gemfile:
gem "bootstrap"
gem "sassc-rails"
@rubyandcoffee
rubyandcoffee / iTerm2 AutoComplete
Created November 3, 2020 17:13
iTerm2 AutoComplete
cmd ;
@rubyandcoffee
rubyandcoffee / iTerm2 Documentation Highlights
Last active November 3, 2020 17:11
iTerm2 Documentation Highlights
https://www.iterm2.com/documentation-highlights.html
@rubyandcoffee
rubyandcoffee / terminal
Created August 26, 2020 13:52
Time in Ruby
time = Time.new(0)
time.utc.strftime("%H:%M:%S")
@rubyandcoffee
rubyandcoffee / terminal
Last active July 6, 2020 16:32
Issues with brew permissions, can't link, etc
sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*
@rubyandcoffee
rubyandcoffee / terminal
Last active December 15, 2021 22:21
Skip testing framework + use PostgreSQL when creating Rails app
rails new app-name -T -d postgresql
Then add gem 'rspec-rails' to Gemfile (test + dev env), bundle, and run: rails generate rspec:install
Also add the following for debugging:
group :development do
gem 'better_errors'
gem 'binding_of_caller'
end
@rubyandcoffee
rubyandcoffee / terminal
Last active May 22, 2022 16:22
Error: Rails is not currently installed on this system.
If you're receiving the following error:
Rails is not currently installed on this system.
Then you're probably on a Ruby version which doesn't have Rails installed.
To fix, switch to a Ruby version which does have Rails installed.
If you've tried to install Rails, and you're receiving a PERMISSIONS error,
then you're probably using the default system-installed Ruby, instead of the Ruby version manager-installed version (e.g. installed using ruby-install).
@rubyandcoffee
rubyandcoffee / iTerm
Last active February 21, 2020 19:40
All commands in terminal are broken
If no commands work in the terminal, and you are receiving this error (or similar):
-bash: ls: command not found
Then run:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
@rubyandcoffee
rubyandcoffee / Ruby with chruby
Last active February 23, 2024 11:34
chruby - Installing and managing Ruby versions
To install chruby and ruby-install:
brew install chruby ruby-install
To install Ruby using ruby-install:
ruby-install ruby 2.7.1
NOTE: You can find latest stable version of Ruby here: https://www.ruby-lang.org/en/downloads/
If you have issues installing Ruby then try the following:
brew install openssl@3
ruby-install 3.2.2 -- --with-openssl-dir=$(brew --prefix openssl@3)
@rubyandcoffee
rubyandcoffee / PostgreSQL issues
Created February 18, 2020 21:19
Various issues with PostgreSQL
Run `postgres -D /usr/local/var/postgres` to diagnose issue
If it returns error:
```
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.0.4.
```
Then run `brew postgresql-upgrade-database`