-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrailsrc.md.hide
77 lines (57 loc) · 1.38 KB
/
railsrc.md.hide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#### setting up a new rails project
first of all, don't use a `.railsrc` (it has caused me pain in the past)
```shell
bundle init
bundle exec ruby --version
echo -n "gem 'rails', '~> 6.0.3.1'" >> Gemfile
bundle install
bundle exec rails --version
bundle exec rails help
bundle exec rails new puzzle_shelf ./ \
--skip-action-cable \
--skip-action-mailbox \
--skip-action-mailer \
--skip-active-record \
--skip-listen \
--no-rc \
--skip-spring \
--skip-turbolinks
```
### Maybe you want rspec
```shell
bundle exec ruby --version
bundle exec rails --version
bundle exec rails new appname \
--skip-bundle # ... and all that stuff from above
cd appname
rm -r test
echo -n "gem 'rspec-rails'" >> Gemfile
bundle install
bundle exec rails generate rspec:install
```
## add some dev deps
```ruby
group :development do
gem 'pry-byebug'
gem 'pry-doc'
gem 'pry-rails'
gem 'web-console', '>= 3.3.0' # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
end
```
## install the new deps
```shell
bundle install --with=development
# run my ctags script
cctags.sh
# now try it out
bundle exec rails c
```
## debug some routes
```ruby
Rails.application.routes.url_for({controller: :users, only_path: true})
Rails.application.routes.url_for
ls Rails.application.routes
ls app
pp Rails.application.config.hosts; nil
pp Rails6::Application.config.hosts; nil
```