Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Instalação de sistema desenvolvido em ruby no ambiente de produção
- 1. Liberar execucao no home:
- mount -o remount,rw,exec /tmp
- 2. Instalar dependencias
- sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake libpq-dev git
- 3. Instalar o RVM
- curl -sSL https://get.rvm.io | bash
- source /home/suez/.rvm/scripts/rvm
- 4. Configurar variaveis de ambiente git
- sudo nano ~/.bash_profile
- Inserir na ultima linha: export GIT_SSL_NO_VERIFY=1
- source ~/.bash_profile
- 5. Clonar a aplicacao no /home/suez
- git clone https://gitlab.ifb.edu.br/cdds-ifb/jifb.git
- 6. Mover a aplicacao para /opt
- sudo mv jifb /opt
- 7. Instalar passenger
- - Seguir instrucoes do site: https://www.phusionpassenger.com/library/install/nginx/install/oss/stretch/
- 8. Configuracao nginx
- Criar arquivo /etc/nginx/sites-available/jifb.hom.ifb.local
- server {
- listen 80;
- server_name jifb.hom.ifb.local;
- passenger_enabled on;
- root /opt/jifb/public;
- }
- sudo ln -s /etc/nginx/sites-available/jifb.hom.ifb.local /etc/nginx/sites-enabled/jifb.hom.ifb.local
- 9. Configurar gems da aplicacao
- - Criar o arquivo config/setup_load_paths.rb
- if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
- begin
- gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
- ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
- require 'rvm'
- RVM.use_from_path! File.dirname(File.dirname(FILE))
- rescue LoadError
- raise "RVM gem is currently unavailable."
- end
- end
- If you're not using Bundler at all, remove lines bellow
- ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(FILE))
- require 'bundler/setup'
- - Criar o arquivo .ruby-version com o codigo: 2.3.1
- - Criar o arquivo .ruby-gemset com o codigo: jifb
- - Instalar o ruby 2.3.1:
- rvm install 2.3.1
- - Sair e entrar na pasta do projeto:
- cd .
- - Instalar as gems:
- gem install bundler
- bundle install
- 10. Criar o arquivo config/database.yml
- production:
- adapter: postgresql
- database: jifb
- host: 10.6.2.18
- username: root
- password: ***
- encoding: utf8
- port: 5432
- 11. Configurar chave secreta da aplicacao:
- RAILS_ENV=production rake secret # para gerar a chave
- - Editar arquivo ~/.bash_profile
- export SECRET_KEY_BASE=<colar chave gerada>
- 12. Configurar a aplicacao:
- RAILS_ENV=production rake db:create && RAILS_ENV=production rake db:migrate && RAILS_ENV=production rake assets:precompile && sudo /etc/init.d/nginx restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement