Advertisement
Guest User

Untitled

a guest
Mar 12th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. [PASSOS @ INSTALACAO THINGSPEAK SERVER]
  2.  
  3. 1) sudo apt update
  4.  
  5. 2) sudo apt dist-upgrade
  6.  
  7. 3) sudo apt purge ruby [nao estava instalado anyway]
  8.  
  9. 4) sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev git-core curl rubygems
  10. [Mysql ROOT User PWD @ a mesma que a do root@server]
  11.  
  12. 5) gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  13. [*NOT WORKING*] => sudo apt install gnupg2
  14. * apt get install pacman
  15. * apt get install dirmngr
  16.  
  17. 6) curl -L https://get.rvm.io | bash -s stable
  18. * First you need to add all users that will be using rvm to 'rvm' group,
  19. and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
  20.  
  21. * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
  22. in all your open shell windows, in rare cases you need to reopen all shell windows.
  23.  
  24. 7) [x] source ~/.rvm/scripts/rvm
  25. [*NOT WORKING*] => USAR em vez do 7: source /etc/profile.d/rvm.sh
  26.  
  27. 8) rvm install ruby 2.1.0
  28.  
  29. 9) rvm docs generate-ri
  30. [Ruby was built without documentation, to build it run: rvm docs generate-ri]
  31.  
  32. *****[INSTALACAO THINGSPEAK SERVER]*****
  33. 10) git clone https://github.com/iobridge/thingspeak.git
  34. LOCALIZACAO: /thingspeak/
  35.  
  36. 11) cd thingspeak/
  37.  
  38. 12) gem install bundler
  39.  
  40. 13) bundle install
  41. - Refere para nao instalar como root, mas instalei como root!
  42. installing your bundle as root will break this application for all non-root users
  43. on this machine.
  44. The git source `git://github.com/moomerman/twitter_oauth.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
  45. The git source `git://github.com/simplificator/rwebthumb.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
  46. The git source `git://github.com/gregbell/active_admin.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
  47.  
  48. 14) cp config/database.yml.example config/database.yml
  49. It’s recommended to change the username and password in config/database.yml for test, development and production databases with your own for security purpose.
  50.  
  51. 15) nano config/database.yml
  52. * Vou mudar as passwords para development, teste e production
  53. * OLD CREDENTIALS @ username: thing ; password: "speak"
  54. * NEW CREDENTIALS @ username: anonthings; password: "anonymous"
  55.  
  56. 16) rake db:create [ERROR]
  57. (in /root/thingspeak)
  58. rake aborted!
  59. Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'.
  60. Gem Load Error is: uninitialized constant Mysql2::Client::SECURE_CONNECTION
  61.  
  62. 17) bundle show mysql2
  63. /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.16
  64.  
  65. 18) bundle update mysql2
  66.  
  67. 19) bundle show mysql2
  68. /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.4.5
  69.  
  70. 20) rake db:create [ERROR]
  71. Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
  72.  
  73. 21) cd thingspeak
  74.  
  75. 22) nano Gemfile
  76. adicionar a frente de gem 'mysql2', '~> 0.3.18'
  77.  
  78. 23) bundle update mysql2
  79.  
  80. 24) bundle show mysql2
  81. /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.21
  82.  
  83. 25) rake db:create [ERROR - PERMISSION]
  84. Access denied for user 'anonthings'@'localhost' (using password: YES)Please provide the root password for your mysql installation
  85.  
  86. 26) mysql -u root -p
  87.  
  88. 27) GRANT ALL PRIVILEGES ON *.* TO 'anonthings'@'localhost' WITH GRANT OPTION;
  89.  
  90. 28) commit;
  91.  
  92. 29) exit;
  93.  
  94. 30) rake db:create
  95.  
  96. 31) rake db:schema:load [ERROR]
  97.  
  98. 32) We’ll need to create config/initializers/abstract_mysql2_adapter.rb file with:
  99. class ActiveRecord::ConnectionAdapters::Mysql2Adapter
  100. NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
  101. end
  102.  
  103. 33) Then we need add the following line at the end of config/environment.db
  104. require File.expand_path('../../config/initializers/abstract_mysql2_adapter', __FILE__)
  105.  
  106. 34) rake db:schema:load
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement