Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added leaflet-fullHash object #622

Closed
wants to merge 5 commits into from
Closed

added leaflet-fullHash object #622

wants to merge 5 commits into from

Conversation

konolga
Copy link

@konolga konolga commented May 20, 2019

Fixes #621 Add Leaflet FullHash object for dynamic URL

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@welcome
Copy link

welcome bot commented May 20, 2019

Thanks for opening this pull request! Dangerbot will test out your code and reply in a bit with some pointers and requests.
There may be some errors, but don't worry! We're here to help! 👍🎉😄

@codeclimate
Copy link

codeclimate bot commented May 20, 2019

Code Climate has analyzed commit d38e602 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented May 20, 2019

Codecov Report

Merging #622 into main will increase coverage by 28.77%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #622       +/-   ##
===========================================
+ Coverage   42.45%   71.22%   +28.77%     
===========================================
  Files          35       32        -3     
  Lines        1524     1279      -245     
===========================================
+ Hits          647      911      +264     
+ Misses        877      368      -509
Impacted Files Coverage Δ
app/models/annotation.rb 80% <0%> (-20%) ⬇️
app/models/user.rb 90.62% <0%> (-5.81%) ⬇️
app/models/export.rb 94.44% <0%> (-5.56%) ⬇️
app/models/map.rb 87.75% <0%> (-1.91%) ⬇️
app/helpers/users_helper.rb 20.83% <0%> (-0.91%) ⬇️
app/controllers/feeds_controller.rb 100% <0%> (ø) ⬆️
app/models/tag.rb 100% <0%> (ø) ⬆️
app/models/node.rb 100% <0%> (ø) ⬆️
app/models/comment.rb 100% <0%> (ø) ⬆️
app/controllers/images_controller.rb 75.36% <0%> (ø) ⬆️
... and 19 more

@konolga
Copy link
Author

konolga commented May 20, 2019

@sashadev-sky please review now

Copy link
Member

@sashadev-sky sashadev-sky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job thank you!!! 😊 PR itself is perfect

Requesting a confirmation on the code from @sagarpreet-chadha (I haven't tested this code locally myself)

Copy link
Contributor

@sagarpreet-chadha sagarpreet-chadha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @konolga ,
Great work 😄 💯 !!!
Can you post a screenshot of the Address bar showing the URL ?
It should be like this : localhost:3000/#2/43.0/2.8/BL1MapK...

Thanks :)

@grvsachdeva
Copy link
Member

grvsachdeva commented May 26, 2019

Hi @konolga, just wanted to ask, if you want any help here? Thanks!

@konolga
Copy link
Author

konolga commented May 28, 2019

Hi @konolga, just wanted to ask, if you want any help here? Thanks!

hi @gauravano , sorry for the late reply. I need help here, I am not familiar with Ruby actually and failed to install it correctly in order to run app. Maybe making such a screenshot can be FTO for someone else?

@sashadev-sky
Copy link
Member

@konolga no problem! What part was not working for you / is there an error message you can share ? The FTOs are here to help people acclimate not only with Git but also with the Rails setup. We are going through a lot of Rails updates right now to improve the setup experience but for now bear with us!

@konolga
Copy link
Author

konolga commented May 30, 2019

I tried both, install on my mac and cloud9, stuck with sql, errors are similar, so i am coping here only output from my mac:
First:

An error occurred while installing mysql2 (0.3.21), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.21' --source 'https://rubygems.org/'` succeeds
before bundling.

Then i install mysql and getting this:

gem install mysql2 -v '0.3.21' --source 'https://rubygems.org/'Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

current directory: /Users/olga/.rvm/gems/ruby-2.4.6/gems/mysql2-0.3.21/ext/mysql2

/Users/olga/.rvm/rubies/ruby-2.4.6/bin/ruby -I /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/site_ruby/2.4.0 -r ./siteconf20190530-50058-12k4phs.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes

Using mysql_config at /usr/local/bin/mysql_config

checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes

Setting rpath to /usr/local/Cellar/mysql/8.0.16/lib

creating Makefile

current directory: /Users/olga/.rvm/gems/ruby-2.4.6/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean

current directory: /Users/olga/.rvm/gems/ruby-2.4.6/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
client.c:367:33: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
elapsed_time = end_time - start_time;
~ ~~~~~~~~~^~~~~~~~~~~~
client.c:439:3: error: use of undeclared identifier 'my_bool'
my_bool res = mysql_read_query_result(client);
^
client.c:441:19: error: use of undeclared identifier 'res'
return (void *)(res == 0 ? Qtrue : Qfalse);
^
client.c:762:3: error: use of undeclared identifier 'my_bool'
my_bool boolval;
^
client.c:793:7: error: use of undeclared identifier 'boolval'
boolval = (value == Qfalse ? 0 : 1);
^
client.c:794:17: error: use of undeclared identifier 'boolval'
retval = &boolval;
^
client.c:797:10: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'?
case MYSQL_SECURE_AUTH:
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
/usr/local/Cellar/mysql/8.0.16/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
client.c:798:7: error: use of undeclared identifier 'boolval'
boolval = (value == Qfalse ? 0 : 1);
^
client.c:799:17: error: use of undeclared identifier 'boolval'
retval = &boolval;
^
client.c:830:38: error: use of undeclared identifier 'boolval'
wrapper->reconnect_enabled = boolval;
^
client.c:1152:56: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
mysql2rb = mysql2_mysql_enc_name_to_rb(charset_name, charset_name_len);
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~
client.c:1185:38: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'?
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
/usr/local/Cellar/mysql/8.0.16/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
2 warnings and 10 errors generated.
make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/olga/.rvm/gems/ruby-2.4.6/gems/mysql2-0.3.21 for inspection.
Results logged to /Users/olga/.rvm/gems/ruby-2.4.6/extensions/x86_64-darwin-18/2.4.0/mysql2-0.3.21/gem_make.out

@grvsachdeva
Copy link
Member

Hi @konolga, don't worry, we are here to help. I found https://stackoverflow.com/questions/51228905/rails-error-installing-mysql2-mysql2-0-3-20 and https://stackoverflow.com/questions/50909928/installing-mysql-2-gem-fails which might work for you. Wanna try?

Also, @sashadev-sky uses Mac so she can surely help you with installation if the above StackOverflow threads don't work for you. Thanks!

@sashadev-sky
Copy link
Member

@konolga the first issue above is that you are using mySQL 8.0.16, but we use 5.7.

I made a MYSQL.md installation file a while back for Mac and I never got anyone else to run through it - so you could help a lot by trying it!! (It might not work).

You want to uninstall the version you are currently using first so there aren't any conflicts - if you have it installed in homebrew this covers that. Community Server you can just google it

Also - let me know if you have MacOS Mojave because then you need to do a few other steps

https://github.com/publiclab/mapknitter/blob/main/MYSQL.md

@konolga
Copy link
Author

konolga commented May 31, 2019

yes, i am using Mojave. I've reinstalled mysql 5.7, but still have issues with it:

Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (cannot load such file -- mysql2/mysql2) (LoadError)

@sashadev-sky
Copy link
Member

@konolga Oh thats awesome! I think that means it worked. The mysql2 error is not OS related.

  • Do you have a database.yml set up for adapter: mysql2?

@konolga
Copy link
Author

konolga commented Jun 6, 2019

yes i do have database.yml.
Also I was getting this error when try bundle exec rake db:setup

> DEPRECATION WARNING: Support for Rails versions before 4.2 is deprecated and will be removed from skylight 2.0. (called from <top (required)> at /Users/olga/Documents/GitHub/mapknitter/config/application.rb:7)
> rake aborted!

So I updated to Rails 5.2 and got this:

LoadError: cannot load such file -- rails/all

So I deleted Gemfile and copied it again from the source and run gem install bundler , it is successful. Now I run bundle exec rake db:setup and it says:

Could not find gem 'rails (~> 3.2)' in any of the gem sources listed in your Gemfile.

So I delete rails 5.2. Now I guess i should install specifically rails 3.2, but i don't know how. So I think to run bundle install, error is:

Bundler could not find compatible versions for gem "activerecord":
In snapshot (Gemfile.lock):
activerecord (= 5.2.3)

In Gemfile:
friendly_id was resolved to 5.2.5, which depends on
activerecord (>= 4.0.0)

rails (~> 3.2) was resolved to 3.2.2.rc1, which depends on
  activerecord (= 3.2.2.rc1)

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

Now time for bundle update, and new error:

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (> 3.2) was resolved to 3.2.22.5, which depends on
bundler (
> 1.0)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?

Could not find gem 'bundler (> 1.0)', which is required by gem 'rails (> 3.2)', in any
of the sources.

so i will be updating packages one by one, this how i spent more than 10 hours (!) trying to run.

Guys, please advise or remove me from the issue, i really stuck by updating/removing these packages - and again i never saw Ruby in my eyes before this task

@grvsachdeva
Copy link
Member

grvsachdeva commented Jun 6, 2019 via email

@sashadev-sky
Copy link
Member

@konolga

  • For the bundler error - its referring to the lines at the bottom of gemfile.lock :

    mapknitter/Gemfile.lock

    Lines 247 to 248 in 03deef1

    BUNDLED WITH
    1.16.6
    . The > in your error message means any version 1.x.x is ok. To fix this run:
$ gem install bundler -v 1.0.10
$ bundle _1.0.10_ install
  • you always want to stick to the Rails version defined in the gemfile. Updating a major version for Rails is a huge task - its one of our summer of code projects! To change the rails version back - you can just update this line and run $ bundle install again:

gem "rails", "~>3.2"

  • Make sure to also change back to the mysql2 gem if you followed the "gem install activerecord-mysql2-adapter" prompt. i've had this issue before and every resource i've seen said not to do that.
    And do gem uninstall activerecord-mysql2-adapter if you did.

  • I get the deprecation warning too - but they don't abort database setup for me so it's just a problem with mysql still.

  • Last thing I can suggest after you fix all of the above: - this is what finally fixed it for me when I first switched to mojave. Its for mojave specifically:

$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"

And I don't remember if I ever did this but this is for mojave too: "Mojave changed the location of header files necessary for compiling C extensions."

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

@sashadev-sky
Copy link
Member

@konolga hey I know you're busy, sorry!! I was hoping you could try these out though :) I am trying to get down the installation process for macOS mojave and it would be a great help if you tried it

@konolga
Copy link
Author

konolga commented Jun 14, 2019

@sashadev-sky No problem if you can guide me. So I've followed all the steps successfully. Now i am getting this

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (> 3.2) was resolved to 3.2.22.5, which depends on
bundler (
> 1.0)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?

Could not find gem 'bundler (> 1.0)', which is required by gem 'rails (> 3.2)', in any of the
sources.
Olgas-MBP:mapknitter olga$ gem install bundler -v 1.0.10
Successfully installed bundler-1.0.10
Parsing documentation for bundler-1.0.10
Done installing documentation for bundler after 1 seconds
1 gem installed
Olgas-MBP:mapknitter olga$ bundle update
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (> 3.2) was resolved to 3.2.22.5, which depends on
bundler (
> 1.0)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?

Could not find gem 'bundler (> 1.0)', which is required by gem 'rails (> 3.2)', in any of the
sources.

@sashadev-sky
Copy link
Member

sashadev-sky commented Jun 14, 2019

@konolga thank you! Instead of $bundle update or $ bundle install you must run $ bundle _1.0.10_ install so just tries those two commands again:

$ gem install bundler -v 1.0.10
$ bundle _1.0.10_ install

Btw the bright side of this is once its setup ur good to go always!

@konolga
Copy link
Author

konolga commented Jun 14, 2019

Without errors i managed to do this ( suggested by you versions $bundle/rails were returning errors, not sure why below didn't work at first place)

gem 'rails', '4.2.11.1'
gem install bundler -v 1.17.3
bundle _1.17.3_ install
bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Now can you please advise how to configurate database?

App 22836 output: Error: The application encountered the following error: Could not load 'active_record/connection_adapters/mysql2_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (LoadError)

@sashadev-sky
Copy link
Member

This is my database.yml:

development:
adapter: mysql2
username: sashaboginsky
password: rootroot
database: mapknitter_development

production:
adapter: mysql2
host: localhost
username: sashaboginsky
password: rootroot
database: mapknitter

test:
adapter: mysql2
username: sashaboginsky
password: rootroot
database: mapknitter_test

Do you have this file in config folder? all these fields defined? Database can be whatever you would like I think, and username and password is what you originally setup during mysql setup

@konolga
Copy link
Author

konolga commented Jun 14, 2019

i just check - yes, i have it. But when i start server by mysql -u <username> -p I see Server version: 8.0.16 MySQL Community Server - GPL So how to start [email protected] instead or remove 8.0.16?

@sashadev-sky
Copy link
Member

@konolga yeah completely uninstall and remove that. Try to delete any folders you see related to it in your system too, having these two versions at once can make many problems

Do you have @5.7 installed? you can check with $ mysql --version

if you don't, then just follow the workflow in MYSQL.md

if you do, confirm you can run it: $ brew services start [email protected] $ brew services list should show its there.

Then I think you should be good to go!

@konolga
Copy link
Author

konolga commented Jun 22, 2019

My database.yml file is:
development:
adapter: mysql2
username: mapknitter
password: mapknitter
database: mapknitter_dev

production:
adapter: mysql2
host: localhost
username: mapknitter
password: mapknitter
database: mapknitter

test:
adapter: mysql2
username: mapknitter
password: mapknitter
database: mapknitter_test

I uninstalled both mysqls and reinstalled 5.7. I start brew services start [email protected] and bundle exec passenger start, this is output:

Service [email protected] already started, use brew services restart [email protected] to restart.
Olgas-MBP:mapknitter olga$ brew services restart [email protected]
Stopping [email protected]... (might take a while)
==> Successfully stopped [email protected] (label: [email protected])
==> Successfully started [email protected] (label: [email protected])
Olgas-MBP:mapknitter olga$ brew services list
Name Status User Plist
[email protected] started olga /Users/olga/Library/LaunchAgents/[email protected]
redis stopped
unbound stopped
Olgas-MBP:mapknitter olga$ bundle exec passenger start
=============== Phusion Passenger Standalone web server started ===============
PID file: /Users/olga/Documents/GitHub/mapknitter/passenger.3000.pid
Log file: /Users/olga/Documents/GitHub/mapknitter/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/

[ N 2019-06-22 17:14:42.0750 4684/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)
[ E 2019-06-22 17:14:42.0801 4684/T5 Sec/Crypto.cpp:990 ]: Removing Passenger private key from keychain failed: Write permissions error.. Please remove the private key from the certificate labeled Phusion Passenger Open Source in your keychain.
App 4711 output: DEPRECATION WARNING: The configuration option config.serve_static_assets has been renamed to config.serve_static_files to clarify its role (it merely enables serving everything in the public folder and is unrelated to the asset pipeline). The serve_static_assets alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /Users/olga/Documents/GitHub/mapknitter/config/environments/development.rb:37)
App 4711 output: config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
App 4711 output:
App 4711 output: * development - set it to false
App 4711 output: * test - set it to false (unless you use a tool that preloads your test environment)
App 4711 output: * production - set it to true
App 4711 output:
App 4711 output: W, [2019-06-22T17:14:44.000163 #4711] WARN -- Skylight: [SKYLIGHT] [4.0.2] Running Skylight in development mode. No data will be reported until you deploy your app.
App 4711 output: (To disable this message for all local apps, run skylight disable_dev_warning.)
App 4711 output: Error: The application encountered the following error: Could not load 'active_record/connection_adapters/mysql2_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (LoadError)
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in block in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in load_dependency'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/mysql2-0.3.21/lib/mysql2.rb:31:in <top (required)>'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in block in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in load_dependency'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/mysql2_adapter.rb:4:in <top (required)>'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in block in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in load_dependency'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/connection_specification.rb:175:in spec'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/connection_handling.rb:50:in establish_connection' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/railtie.rb:122:in block (2 levels) in class:Railtie'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/lazy_load_hooks.rb:38:in execute_hook'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/lazy_load_hooks.rb:44:in each'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/base.rb:315:in module:ActiveRecord'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activerecord-4.2.11.1/lib/active_record/base.rb:26:in <top (required)>' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in block in require'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in load_dependency' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in require'
App 4711 output: /Users/olga/Documents/GitHub/mapknitter/config/initializers/column_definition.rb:19:in <class:ColumnDefinition>' App 4711 output: /Users/olga/Documents/GitHub/mapknitter/config/initializers/column_definition.rb:17:in <top (required)>'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in load' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in block in load'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in load_dependency' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in load'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:652:in block in load_config_initializer' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/activesupport-4.2.11.1/lib/active_support/notifications.rb:166:in instrument'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:651:in load_config_initializer' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:616:in block (2 levels) in class:Engine'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:615:in each' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:615:in block in class:Engine'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:30:in instance_exec' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:30:in run'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:55:in block in run_initializers' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:228:in block in tsort_each'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:431:in each_strongly_connected_component_from' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:421:in block in each_strongly_connected_component_from'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:44:in each' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:44:in tsort_each_child'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:415:in call' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:415:in each_strongly_connected_component_from'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:349:in block in each_strongly_connected_component' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in each'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in call' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in each_strongly_connected_component'
App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:226:in tsort_each' App 4711 output: /Users/olga/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:205:in tsort_each'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/initializable.rb:54:in run_initializers' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/application.rb:352:in initialize!'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/railtie.rb:194:in public_send' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/railtie.rb:194:in method_missing'
App 4711 output: /Users/olga/Documents/GitHub/mapknitter/config/environment.rb:5:in <top (required)>' App 4711 output: config.ru:3:in require'
App 4711 output: config.ru:3:in block in <main>' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/rack-1.6.11/lib/rack/builder.rb:55:in instance_eval'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/rack-1.6.11/lib/rack/builder.rb:55:in initialize' App 4711 output: config.ru:1:in new'
App 4711 output: config.ru:1:in <main>' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/helper-scripts/rack-preloader.rb:101:in eval'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/helper-scripts/rack-preloader.rb:101:in preload_app' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/ App 4711 output: src/helper-scripts/rack-preloader.rb:189:in block in module:App'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:380:in run_block_and_record_step_progress' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/helper-scripts/rack-preloader.rb:188:in module:App'
App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' App 4711 output: /Users/olga/.rvm/gems/ruby-2.4.6/gems/passenger-6.0.2/src/helper-scripts/rack-preloader.rb:29:in

'
[ E 2019-06-22 17:14:44.2886 4684/Tz age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /Users/olga/Documents/GitHub/mapknitter: The application encountered the following error: Could not load 'active_record/connection_adapters/mysql2_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (LoadError)
Error ID: affd8574
Error details saved to: /var/folders/65/grz2pl7d265gtj3ldd25jh0c0000gn/T//passenger-error-l8EWdE.html

[ E 2019-06-22 17:14:44.2979 4684/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is affd8574. Please see earlier logs for details about the error.

@sashadev-sky
Copy link
Member

@konolga woops sorry! I should have indented mine to make it more clear. Does your database.yml have the proper indentation? Like this:

development:
  adapter: mysql2
  username: sashaboginsky
  password: rootroot
  database: mapknitter_development

production:
  adapter: mysql2
  host: localhost
  username: sashaboginsky
  password: rootroot
  database: mapknitter

test:
  adapter: mysql2
  username: sashaboginsky
  password: rootroot
  database: mapknitter_test

indent it then run $ rake db:setup then $ bundle exec passenger start. I just ran it from your fork and everything looks good to go. If $ passenger start gives problems try $ rails s instead but I think it should work! Thank you so much!!!

@jywarren
Copy link
Member

@rarrunategu1 just a heads up with regard to the dependency work you're doing! Would be good to coordinate just in case.

@sashadev-sky
Copy link
Member

@jywarren @rarrunategu1 no dependency changes here! @konolga is just helping me fix the MYSQL.md file I wrote so that it works for macOS mojave.

The change made in the PR is based on a dependency update that was already merged (leaflet-fullhash)

@rarrunategu1
Copy link
Collaborator

Hello @sashadev-sky, I'm working on a dependabot for leaflet-fullhash. My update worked out differently than dependabot suggested but it works. I had to bump it using yarn add. Is there a reason it was installed without a version number on the package.json. The package.json says this:
I don't necessarily understand how to update on the package.json as it is on there:
image
Would one of you please take a look at the comments in issue #731 so that you can see what I'm referring to?

@konolga
Copy link
Author

konolga commented Jun 29, 2019

oh, i had indentation, running rake db:setup gives me

rake aborted!
LoadError: cannot load such file -- right_aws
/Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require' /Users/olga/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.0.2/lib/skylight/core/probes.rb:118:in require'
/Users/olga/Documents/GitHub/mapknitter/lib/tasks/attachment_tasks.rake:2:in <top (required)>' /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:658:in load'
/Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:658:in block in run_tasks_blocks' /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:658:in each'
/Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:658:in run_tasks_blocks' /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/application.rb:452:in run_tasks_blocks'
/Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/engine.rb:453:in load_tasks' /Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/railtie.rb:194:in public_send'
/Users/olga/.rvm/gems/ruby-2.4.6/gems/railties-4.2.11.1/lib/rails/railtie.rb:194:in method_missing' /Users/olga/Documents/GitHub/mapknitter/Rakefile:12:in <top (required)>'
/Users/olga/.rvm/gems/ruby-2.4.6/gems/rake-12.3.2/exe/rake:27:in <top (required)>' /Users/olga/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in eval'
/Users/olga/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in `

'
(See full trace by running task with --trace)

@sashadev-sky
Copy link
Member

sashadev-sky commented Jun 30, 2019

@konolga I rebased your branch so I think that is fixed now as there was an update surrounding right_aws. You can pull the updates from here locally by doing $ git pull origin <branch_name>. Then try the setup again ($ bundle install, $ rake db:setup $ rails s) sometimes you need to also try $ bundle exec bundle install, $ bundle exec rake db:setup

@jywarren
Copy link
Member

jywarren commented Jul 5, 2019

Hi, all - just wanted to say THANK YOU for sticking with this, everyone. I really appreciate how generous you are all being towards one another ❤️.

I also had seen the bundler version error and worked around it similarly. Glad to see that i'm not alone on that!

@konolga
Copy link
Author

konolga commented Jul 5, 2019

@konolga I rebased your branch so I think that is fixed now as there was an update surrounding right_aws. You can pull the updates from here locally by doing $ git pull origin <branch_name>. Then try the setup again ($ bundle install, $ rake db:setup $ rails s) sometimes you need to also try $ bundle exec bundle install, $ bundle exec rake db:setup

I confused with pull request and just deleted files from my computer and pulled again and did everything from the scratch (configured config and database files, $ bundle install, bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include, sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / - that you've recommended earlier) - it is still yelling that mysql2 is required

LoadError: cannot load such file -- mysql2/mysql2

I started to set up mysql again, but stuck at this step:

mysqld -initialize --verbose --user=$(whoami) --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

2019-07-05T16:40:18.644282Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-07-05T16:40:18.644293Z 0 [Note] InnoDB: Unable to open the first data file
2019-07-05T16:40:18.644337Z 0 [ERROR] InnoDB: Operating system error number 35 in a file operation.
2019-07-05T16:40:18.644379Z 0 [ERROR] InnoDB: Error number 35 means 'Resource temporarily unavailable'
2019-07-05T16:40:18.644388Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2019-07-05T16:40:18.644402Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2019-07-05T16:40:18.644418Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2019-07-05T16:40:18.644662Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2019-07-05T16:40:18.953703Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-07-05T16:40:18.953745Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-07-05T16:40:18.953760Z 0 [ERROR] Failed to initialize builtin plugins.

Should we drop it here? Cause installation process now went smoothly and issue is in sql only.

@sashadev-sky
Copy link
Member

@konolga yes we can drop here. You got me as far as figuring out what commands need to be run on macOS mojave in order to fix the mySQL installation path. I think the whole installation works now, but the way we are debugging remotely like this it's easy to miss something.

I am going to update the docs now!! Thank you!!! ❤️Obviously if you yourself want to get mySQL up and running I would be happy to keep running through it with you!

I will also review this PR now so it can get merged

@sashadev-sky sashadev-sky mentioned this pull request Jul 9, 2019
5 tasks
@sashadev-sky
Copy link
Member

@sagarpreet-chadha there is a rebase issue here (I will fix that if we want to merge), but I copied the updates @konolga made in her first commit, which matched what was requested in #621, and there is no update to the url.

I'm not familiar with this code, can you please advise? The only layer we have on the map is called Mapknitter? Is this update meant to work with future integration of multiple layers from LEL?

@jywarren

Copy link
Contributor

@sagarpreet-chadha sagarpreet-chadha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sashadev-sky ,
The code seems correct . What is the URL when you open the website first time ?
And what is the URL if you add more layers to the map on the main page ?
Thanks!

@sashadev-sky
Copy link
Member

@sagarpreet-chadha if you can look into it that would be great! I am not sure how to add additional layers and I'm a bit confused where we use the hash object we create.

@sashadev-sky
Copy link
Member

closing due to being stale! @sagarpreet-chadha
sorry for the mess here @konolga and thank you so much for your time helping me to update the installation docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Leaflet FullHash object for dynamic URL
6 participants