Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [PASSOS @ INSTALACAO THINGSPEAK SERVER]
- 1) sudo apt update
- 2) sudo apt dist-upgrade
- 3) sudo apt purge ruby [nao estava instalado anyway]
- 4) sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev git-core curl rubygems
- [Mysql ROOT User PWD @ a mesma que a do root@server]
- 5) gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- [*NOT WORKING*] => sudo apt install gnupg2
- * apt get install pacman
- * apt get install dirmngr
- 6) curl -L https://get.rvm.io | bash -s stable
- * First you need to add all users that will be using rvm to 'rvm' group,
- and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
- * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
- in all your open shell windows, in rare cases you need to reopen all shell windows.
- 7) [x] source ~/.rvm/scripts/rvm
- [*NOT WORKING*] => USAR em vez do 7: source /etc/profile.d/rvm.sh
- 8) rvm install ruby 2.1.0
- 9) rvm docs generate-ri
- [Ruby was built without documentation, to build it run: rvm docs generate-ri]
- *****[INSTALACAO THINGSPEAK SERVER]*****
- 10) git clone https://github.com/iobridge/thingspeak.git
- LOCALIZACAO: /thingspeak/
- 11) cd thingspeak/
- 12) gem install bundler
- 13) bundle install
- - Refere para nao instalar como root, mas instalei como root!
- installing your bundle as root will break this application for all non-root users
- on this machine.
- 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.
- 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.
- 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.
- 14) cp config/database.yml.example config/database.yml
- 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.
- 15) nano config/database.yml
- * Vou mudar as passwords para development, teste e production
- * OLD CREDENTIALS @ username: thing ; password: "speak"
- * NEW CREDENTIALS @ username: anonthings; password: "anonymous"
- 16) rake db:create [ERROR]
- (in /root/thingspeak)
- rake aborted!
- Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'.
- Gem Load Error is: uninitialized constant Mysql2::Client::SECURE_CONNECTION
- 17) bundle show mysql2
- /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.16
- 18) bundle update mysql2
- 19) bundle show mysql2
- /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.4.5
- 20) rake db:create [ERROR]
- Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
- 21) cd thingspeak
- 22) nano Gemfile
- adicionar a frente de gem 'mysql2', '~> 0.3.18'
- 23) bundle update mysql2
- 24) bundle show mysql2
- /usr/local/rvm/gems/ruby-2.1.0@thingspeak/gems/mysql2-0.3.21
- 25) rake db:create [ERROR - PERMISSION]
- Access denied for user 'anonthings'@'localhost' (using password: YES)Please provide the root password for your mysql installation
- 26) mysql -u root -p
- 27) GRANT ALL PRIVILEGES ON *.* TO 'anonthings'@'localhost' WITH GRANT OPTION;
- 28) commit;
- 29) exit;
- 30) rake db:create
- 31) rake db:schema:load [ERROR]
- 32) We’ll need to create config/initializers/abstract_mysql2_adapter.rb file with:
- class ActiveRecord::ConnectionAdapters::Mysql2Adapter
- NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
- end
- 33) Then we need add the following line at the end of config/environment.db
- require File.expand_path('../../config/initializers/abstract_mysql2_adapter', __FILE__)
- 34) rake db:schema:load
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement