###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
| gem install rmagick -v '2.13.4' --source 'https://rubygems.org/' | |
| brew unlink imagemagick | |
| brew install imagemagick@6 && brew link imagemagick@6 --force | |
| echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile |
| # make directory for new rails app | |
| mkdir app | |
| cd app | |
| # specify ruby version | |
| echo 2.6.3 > .ruby-version | |
| echo "source 'https://rubygems.org'" > Gemfile | |
| echo "gem 'rails', '~> 6.1.0.alpha', git: 'https://github.com/Shopify/rails'" >> Gemfile | |
| OR gem 'rails', '~> 6.1.0.alpha', git: 'https://github.com/Shopify/rails' |
| $ brew uninstall postgresql | |
| $ gem uninstall pg # ALL OF THEM | |
| $ rm -fr /usr/local/var/postgres | |
| $ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| $ pg_ctl -D /usr/local/var/postgres stop -s -m fast # WE SHOULD HAVE ALL postgres SERVERS & PROCESSES STOPPED BY NOW | |
| $ brew install postgres | |
| $ env ARCHFLAGS="-arch x86_64" gem install pg | |
| $ echo "DONE." >> /dev/null | |
###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
###Step 1: Install XCode
Check if the full Xcode package is already installed:
$ xcode-select -p
If you see:
/Applications/Xcode.app/Contents/Developer
| # SSL self signed localhost for rails start to finish, no red warnings. | |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| "" | |
| "" Janus setup | |
| "" | |
| " Define paths | |
| let g:janus_path = escape(fnamemodify(resolve(expand("<sfile>:p")), ":h"), ' ') | |
| let g:janus_vim_path = escape(fnamemodify(resolve(expand("<sfile>:p" . "vim")), ":h"), ' ') | |
| let g:janus_custom_path = expand("~/.janus") | |
| " Source janus's core |
| var toast=function(msg){ | |
| $("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>") | |
| .css({ display: "block", | |
| opacity: 0.90, | |
| position: "fixed", | |
| padding: "7px", | |
| "text-align": "center", | |
| width: "270px", | |
| left: ($(window).width() - 284)/2, | |
| top: $(window).height()/2 }) |
| " PLUGINS | |
| " vim-rails | |
| " grep.vim | |
| " nerdcommenter | |
| " nerdtree | |
| " snipmate.vim | |
| " vim-fugitive | |
| " vim-fuzzyfinder-pathogen | |
| " vim-ragtag | |
| " vim-surround |
| class Post < ActiveRecord::Base | |
| attr_accessible :text, :title, :user_id, :category_id | |
| validates :title, presence: true | |
| validates :category_id, presence: true | |
| validates_length_of :title, maximum:15 | |
| validates :text, presence:true | |
| belongs_to :user | |
| has_many :comments, :dependent => :destroy, foreign_key: :post_id | |
| belongs_to :category |