Advertisement
Guest User

Untitled

a guest
May 21st, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. # Instructions: Rails & PostgreSQL
  2.  
  3. - Creating a new rails app using postgresql
  4. `$ mkdir rails_projects
  5. $ cd rails_projects
  6. $ rails new myapp --database=postgresql
  7. $ cd myapp`
  8.  
  9. - Run bundle install
  10. `$ bundle update
  11. $ bundle install`
  12.  
  13. - Update the passwords in the `config/database.yml` file
  14. username: myapp
  15. password: password
  16.  
  17. - Create a user in postgresql
  18. $ createuser myapp
  19.  
  20. - Create test, development and production databases
  21. $ createdb -Omyapp -Eunicode myapp_development
  22. $ createdb -Omyapp -Eunicode myapp_test
  23. $ createdb -Omyapp -Eunicode myapp_production
  24.  
  25. - Test the rails server
  26. $ rails s
  27.  
  28. - Append the following lines to the Gemfile
  29. # Use rspec as the testing framework
  30. group :development, :test do
  31. gem 'rspec-rails', '~> 3.0.0.beta'
  32. end
  33.  
  34. - Install rspec
  35. $ bundle install
  36. $ rails generate rspec:install
  37. Then, delete the test folder in rails.
  38.  
  39. - Create a binstub for the rspec command
  40. $ bundle binstubs rspec-core
  41.  
  42. - Check if you can run rspec
  43. $ rspec
  44.  
  45. - Initialize a git repository
  46. $ git init
  47.  
  48. - Create a new repository on github and follow the 'create repository' instructions
  49. $ git add .
  50. $ git commit -m "[Setup] first commit"
  51. $ git remote add origin git@github.com:user/myapp.git
  52. $ git push -u origin master
  53.  
  54. - Fix SSL errors by using the following command
  55. $ curl -fsSL curl.haxx.se/ca/cacert.pem \
  56. -o "$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement