- create my 1st rails appliactiongot stuck during
1
rails new blog
bundle install
running ctrl+c exit - Change local gem source and run
bundle install
again1
2
3
4
5
6
7cd blog
vim Gemfile
source 'https://gems.ruby-china.com'
#source 'https://rubygems.org'
bundle install
...
Bundle complete! 17 Gemfile dependencies, 75 gems now installed. - Install Yarn and webpacker
tryrails server
got webpacker missing errortry1
/var/lib/gems/2.5.0/gems/webpacker-4.2.2/lib/webpacker/configuration.rb:95:in `rescue in load': Webpacker configuration file not found /home/ubuntu/rails-blog/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /home/ubuntu/rails-blog/config/webpacker.yml (RuntimeError)
rails webpacker:install
got1
Yarn not installed.
- install Yarn
1
2
3curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn - install webpacker
1
2
3rails webpacker:install
...
Webpacker successfully installed
- install Yarn
- Yay! You’re on Rails!
1
rails server
change gem and bundle source
1 | gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ |
Reference from:
Getting Started with Rails
On Debian or Ubuntu Linux, you can install Yarn via our Debian package repository.
- https://gems.ruby-china.com/
- https://bundler.io/v1.16/bundle_config.html