Created
December 8, 2018 04:17
-
-
Save niiku-y/e0575fa9c02a2bf1a9a955c48b58754c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install_rails5.sh | |
sudo apt-get update | |
sudo apt-get install -y ruby sqlite3 libsqlite3-dev | |
sudo apt-get install -y build-essential liblzma-dev patch ruby-dev zlib1g-dev | |
sudo gem install rails | |
APPNAME="app001" | |
rails new $APPNAME | |
cd $APPNAME | |
cat <<EOF >> Gemfile | |
gem 'devise' | |
gem 'activeadmin' | |
gem 'therubyracer' | |
EOF | |
bundle install | |
bin/rails g active_admin:install --skip-users & | |
sleep 2 | |
bin/rails g active_admin:install AdminAccount & | |
sleep 2 | |
sed -e 's/^end/ config.action_mailer.default_url_options = { host: \"localhost\", port: 3000 }\nend/g' \ | |
config/environments/development.rb > config/environments/development.rb.after | |
mv -f config/environments/development.rb.after config/environments/development.rb | |
sed -e 's/^end/ root to: \"home#index\" \nend/g' \ | |
config/routes.rb > config/routes.rb.after | |
mv -f config/routes.rb.after config/routes.rb | |
sed -e 's/<\/body>/<p class=\"notice\"><\%= notice \%><\/p>\n <p class=\"alert\"><\%= alert \%><\/p>\n <\/body>/g' \ | |
app/views/layouts/application.html.erb > app/views/layouts/application.html.erb.after | |
mv -f app/views/layouts/application.html.erb.after app/views/layouts/application.html.erb | |
rails g devise:views | |
sed -e 's/[ ]*\#[ ]*config.default_namespace = :hello_world/ config.default_namespace = :admin_login/g' \ | |
config/initializers/active_admin.rb > config/initializers/active_admin.rb.after | |
mv -f config/initializers/active_admin.rb.after config/initializers/active_admin.rb | |
bin/rake db:migrate | |
bin/rake db:seed | |
bin/rails s -b 0.0.0.0 | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment