publiclab / mapknitter

Upload your own aerial images, position (rubbersheet) them in a web interface over existing map data, and share via web or composite and export for print.

Home Page:http://mapknitter.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support: Installation Issues with MapKnitter

SidharthBansal opened this issue · comments

Facing trouble installing Mapknitter? We are here to help you.

@SidharthBansal After tackling to much issues and setting up ubuntu on vmware, today i was able to manage things.
But a small error is coming as when i use curl -L https://get.rvm.io | bash -s stable it asks for a key and there i am getting timeout error which is annoying me.
Need Help !

Alright, these errors are really annoying.

@SidharthBansal Have you found the solution @jywarren can you provide us help with this?

I think checking rvm.io will show how to install rvm the most standard way.

Working on getting it running in ruby 2.4.4 here, too! #320

Yes https://rvm.io shows how to get the keys!

Does the docker container work properly?
I'm getting an error while building it.

ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update -qq && apt-get install -y bundler libmysqlclient-dev ruby-rmagick libfreeimage3 libfreeimage-dev ruby-dev gdal-bin python-gdal curl libcurl4-openssl-dev libssl-dev zip nodejs-legacy npm ##ALSO TRIED: ruby-pg' returned a non-zero code: 100

Thanks it worked @jywarren but now when i ran bundle exec rake db:setup it asked me a root password which didn't work for mysql and it is throwing an error.
I looked stack overflow and other sites but they to haven't solved the issue.
May i know as how can i see or check the root password in ubuntu ?
Although i will check this again in morning.

Here is a larger error log
I was trying to build the container using docker compose

Hi @Dhiraj240, you can reset the password using - https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html

And, if you still get error - ERROR 1698 (28000): Access denied for user 'root'@'localhost'" error then, checkout this thread - https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost.

I also faced some of these issues but finally able to resolve them.Thanks!

@kaunair please check that you have a recent version of Docker. I found a related issue to your log at Shippable/support#4398 and it was an old Docker version! Try it and let us know, also tell us what command did you run exactly, thanks!

@Dhiraj240 about the MySQL root password if you mean from the container it can be seen in the mysql logs: docker-compose logs db on first run (scroll all the way back).

after bundle install
sudo service mysql start
bundle exec rake db:setup gives Access denied for user 'mapknitter'@'localhost' (using password: YES).
Please provide the root password for your mysql installation

'some random password'
rake aborted!
Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES)

(I already have set root password for mysql while installing sudo apt-get mysql-server. I also tried the stack overflow solution given by @gauravano but it didn't work for me)

Yes, I confirmed they are same. I atried to uninstall and reinstall mysql-server, everything went fine just the last step bundle exec passenger start gave me this
"Message from application: Address already in use - listen(2) (Errno::EADDRINUSE)"
I tried looking over stack overflow, but I didn't find anything in my local running on port 3000

I gave different names to database in development and in testing:

database yml

I faced somewhat similar errors initially, I tried resetting password too but at last I changed the mysql plugin to mysql_native_password instead of auth_socket using - https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost

You can do this on non-root user but changing plugin for root user is really upto you.

Now running "bundle exec passenger start" gives this error
Message from application: Address already in use - listen(2) (Errno::EADDRINUSE).
So by typing sudo lsof -i tcp:3000 i confirmed that there is nothing else going on port 3000 but still doesn't work

you can run the rails server on a different port with rails s -p [port-number] . Also, it's fine to start with default server WebRick for development(when you run server with rails s, webrick is used by default) and you can go with passenger after some time.

Thanks!

Hi, all, thanks to @gauravano and @sashadev-sky we are now on Ruby 2.4.4: #320

@jywarren @gauravano Now, i am getting the following error

bundle exec rake db:setup
rake aborted!
NoMethodError: undefined method `active_record' for #<Rails::Application::Configuration:0x0000556569694a78>
/home/dhiraj/.rvm/gems/ruby-2.4.4/gems/railties-3.2.22.5/lib/rails/railtie/configuration.rb:85:in `method_missing'
/home/dhiraj/mapknitter/config/application.rb:55:in `<class:Application>'
/home/dhiraj/mapknitter/config/application.rb:13:in `<module:Mapknitter>'
/home/dhiraj/mapknitter/config/application.rb:12:in `<top (required)>'
/home/dhiraj/mapknitter/Rakefile:5:in `require'
/home/dhiraj/mapknitter/Rakefile:5:in `<top (required)>'
/home/dhiraj/.rvm/gems/ruby-2.4.4/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/home/dhiraj/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in `eval'
/home/dhiraj/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)

I tried the database configuration given in the above screenshots.

Although i ran bundle update but this problem still persists.

Hey @Dhiraj240, which database config you used, please point to the comment?

I gave different names to database in development and in testing:

database yml

@gauravano this one

commented

Was having trouble with mysql was throwing this error ERROR 1698 (28000): Access denied for user 'root'@'localhost'" error even after following the above steps. What worked for me was removing mysql and deleting mysql user and doing a fresh installation so I can setup a password. Here are the command steps i followed

sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exit

Thank you @cesswairimu!! Would you be interested in adding this to the MYSQL.md file? And any setup recommendations / instructions you have for your OS? Currently we only have steps there for MacOS

commented

Hey @sashadev-sky, sure will do. Thanks

commented

Any fixes for this error mapknitter/tmp/pids/passenger.3000.pid" failed (13: Permission denied) nginx: configuration file nginx.conf test failed when starting the server

Hi @jywarren,
Thanks for responding! Here's my error again after trying to install the project locally. Posting everything just in case. This is while running bundle:

Using libv8 3.16.14.19 (x86_64-darwin-16)
Using mimemagic 0.3.0
Fetching mysql2 0.3.21
Installing mysql2 0.3.21 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/mysql2-0.3.21/ext/mysql2
/Users/emmilie/.rbenv/versions/2.4.4/bin/ruby -r ./siteconf20190329-19328-191030x.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
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /usr/local/Cellar/mysql/8.0.15/lib
-----
creating Makefile

current directory: /Users/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean

current directory: /Users/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
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.15/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: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.15/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
  MYSQL_DEFAULT_AUTH,
  ^
10 errors generated.
make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/mysql2-0.3.21 for inspection.
Results logged to /Users/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/mysql2-0.3.21/gem_make.out

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.

In Gemfile:
  mysql2

When I ran gem install mysql2 -v '0.3.21' --source 'https://rubygems.org/' as suggested, it gave me the following, plus the errors already posted above:

EmmiliesMacBook:mapknitter emmilie$ 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/emmilie/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/mysql2-0.3.21/ex

Thank you and appreciate the help!

commented

Hello @emestabillo, which OS are you using? and just checking did you run sudo apt-get install bundler libmysqlclient-dev imagemagick ruby-rmagick libfreeimage3 libfreeimage-dev ruby-dev libmagickcore-dev libmagickwand-dev ?

Hi @cesswairimu , I am using 10.14.
Yes I've used it but it gives me sudo: apt-get: command not found. So then I replaced sudo apt-get with brew:

EmmiliesMacBook:mapknitter emmilie$ brew install bundler libmysqlclient-dev imagemagick ruby-rmagick libfreeimage3 libfreeimage-dev ruby-dev libmagickcore-dev libmagickwand-dev
Error: No available formula with the name "bundler" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
These similarly named formulae were found:
bundler-completion ✔                                      rbenv-bundler ✔
dylibbundler                                              rbenv-bundler-ruby-version ✔
To install one of them, run (for example):
  brew install bundler-completion ✔
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

I get this after running bundle:

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.

Next, I tried gem install bundler -v 1.0.10 , no errors
However...it crashed with the next one bundle _1.0.10_ install

I’m also okay with finding another repo if I really can’t install...publiclab has lots! Not sure why mapknitter seems to be complicated on my end :-)

Thank you for taking a look!

@emestabillo I get these issues all the time so don't worry!! We can resolve them. For your mysql issue: I also have macOS 10.14 and apparently mysql is stored differently on the new OS versions so its easier to just make your own custom build. try the one below, it worked for me:

$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
  • Also check if you have cmake installed properly with Homebrew. You need that

For Bundler could be a few things: try:

  1. clearing your cache
$ rm -r .bundle
$ bundle install 
  1. uninstall bundler 2

  2. clear it again

  3. check exactly what bundle was used on the lockfile (at the bottom of the lockfile) and run that bundle number like you did bundle _1.0.10 ... above

Let me know if any of this helps!

Hey @emestabillo, sorry for the inconvenience. We are trying hard to make the installation process easy and clearer, and we'll try our best to help you.

We would be done with cloud9 setup #420 very soon. Also, for now, you can fetch the install-script branch on cloud9 and do the work. I can help you with project setup on cloud9.

Thanks!

Thanks for the response @sashadev-sky @gauravano ! Still getting errors with installing locally. I may just have to wait for #420 or the cloud9 option as suggested.

commented

Any fixes for this error mapknitter/tmp/pids/passenger.3000.pid" failed (13: Permission denied) nginx: configuration file nginx.conf test failed when starting the server

Finally found a fix for this. This is what solved it for me

$ sudo chmod o+w -R /tmp/*
$ sudo rm /tmp/pids/server.pid

@emestabillo have you tried @cesswairimu's solution? If the problem still exists, let us know, we'll give you cloud9 invite and you can fetch the PR #420 and complete the setup. Thanks!

Hi @gauravano , yep still having problems. The cloud9 option might be best for now. However..I think the issue I was going to work on may already be solved #454 . (I also couldn't replicate it on the live site). Let me find another one before I bother you :-) Thank you so much for checking in!

hey @emestabillo, although the issue #454 is solved, we have many more issues and we would love to have your help with them.

So, let's ask @jywarren for a cloud9 invite for you. You can use it whenever you want and as PR for setting cloud9 is not complete so you can share the cloud9 workspace with me and I can do the setup for you.

Thanks!

Appreciate the help @gauravano!

Just noting that the install script at https://github.com/publiclab/mapknitter/blob/main/install_cloud.sh now works at https://Codenvy.io ! It's a very easy install process.

@emestabillo did you need an invite? I might've missed an email if you sent it to me but if you still do, please email web@publiclab.org and I can get you one! Or, try Codenvy, which doesn't need an invite! 👍

Hi @jywarren! Let me try it on Codenvy. I’ll message you if I’m still having issues. Thank you!!

Hello, @jywarren I have tried installing on cloud 9 and on a ubuntu terminal I installed for my windows but each of them gave me the same error:
App 21975 output: Error: The application encountered the following error: Access denied for user 'mapknitter'@'localhost' (using password: YES) (Mysql2::Error)
I've signed on to Codenvy seeing as c9 will not be available after June 30th anyway but I don't understand what the install process is. Can someone please help me? I've worked on this endlessly to continue to get the same error result that just about everyone here is getting. I look forward to your reply.

Hey @rarrunategu1
In order to install on Codenvy:

  1. Select a new workspace with the ubuntu stack
  2. Add the URL of your forked version of mapknitter under the projects section. It should be something like https://github.com/USERNAME/mapknitter
  3. Hit create
  4. Go the the directory and run source install_cloud.sh

This should set everything up on codenvy
If you encounter any problems let us know!
Cheers

@kaustubh-nair thank you! I finally have mapknitter on code envy but this other section to install_cloud.sh does not work for me. This is my error -
user@:/projects/mapknitter
$ source install_cloud.sh
bash: install_cloud.sh: No such file or directory

I've done some googling to see what that is about but it all seems very confusing. I ran echo $PATH and this is my result in case it helps
/projects/.che/bin:/usr/local/go/bin:/usr
/lib/jvm/java-1.8.0-openjdk-amd64/bin:/us
r/local/sbin:/usr/local/bin:/usr/sbin:/us
r/bin:/sbin:/bin

I appreciate any guidance you can give me.

Hi @jywarren,
There is a start.sh and install.sh in the mapknitter folder. I don't see a install_cloud.sh folder.

image

OK, how did you set it up? I think the best way would probably be to enter the Git url like this (note that I actually want to point it at my own fork of MapKnitter):

Screen Shot 2019-05-01 at 5 55 24 PM

(also, select "Rails" under "Select Stack")

To fork (for anyone who wants to know), you go to https://github.com/publiclab/mapknitter, and click the Fork button, which copies the project into your own account, so for me, it makes https://github.com/jywarren/mapknitter. Then, you have an online space corresponding to your work, and can push code there:

Screen Shot 2019-05-01 at 5 55 42 PM

Then i pressed Save, then Create in the upper right corner.

If you log into github you can select the project this way (only if you've already forked it):

Screen Shot 2019-05-01 at 6 03 27 PM


AHA! @rarrunategu1 I realized what happened! It assumes the default branch is master, but we are tending to use main instead of master on projects more and more. So, to switch and get the latest main branch, you can do:

git checkout -b main && git pull https://github.com/publiclab/mapknitter main

This will get the latest code. SORRY ABOUT THAT!!! 🎉

@emestabillo @rarrunategu1 I also encountered the issue @emestabillo saw in cloud9, of:

Bundler could not find compatible versions for gem "bundler":

And i also tried gem install bundler -v 1.0.10, and after that, i was able to start it with rails s.

It's running now. But this is a weird question, I'm not sure how to open it in a new browser tab and interact with the site! Uh......

codenvy/codenvy#2503 ... researching...

@jywarren Thank you. I was able to source install_cloud.sh, however I'm still not able to run. I installed everything that your video says to install and in their right places and when I try to run it I'm getting errors. I did notice that the file has a database.yml and config.yml file already so I didn't copy those. Could that cause an issue? Here's my error:
image
Even when I try to run it at the top of codenvy I get this error:
image
I did try to run gem install bundler -v 1.0.10 but I don't have write permission.

Ah, you're getting further than me! Your run command looks to be trying to use the go programming language. See if you can edit the run command to use rails s -p 51656 instead of go get && go run main.go... now, i have to find how you got the preview URL to appear!

OK, i changed my whole run command to, in full, cd /projects/mapknitter && source ~/.profile && rails s -p 49286 (but you should use your own port number 51656). I got it to boot but it's not showing me the preview URL... weird...

Thank you @jywarren . This looks like a great guide. I'll follow it and see what I come up with.

I think the preview URL is when using the rails stack option, and you should be able to trust it rather than hunting through it as in the railsgirls.com guide -- that probably is for an older version where they didn't so conveniently show you the URL!

OK! I was able to get it running by making that change to the run command:

cd ${current.project.path} && source ~/.profile && rails server -b 0.0.0.0

Screen Shot 2019-05-01 at 7 57 36 PM

image

@SidharthBansal this could be a good way to test out your login changes!

Hi unfortunately I continue to have issues with getting it to run. I'm getting the following error which means I don't have rails right?
image
So I went looking back to see what was installed and I don't see a .gem file, I can't use rvm...or bundle install..etc.... when I thought all of that was fine before. I'll give it another go tomorrow but if anyone has come across this issue of codenvy not letting you install rails or gems please let me know. Thank you.

Hi @jywarren , I clicked on the folder and it returned what I needed but still it gave me issues. I restarted everything using a rails default stack instead of the go default which is what I understood we had to use. That one went by so smoothly and I now have a running application with all of your and everyone else's directions from above. The teamwork here is truly amazing. Thank you so much! Now I can dive into some of these issues.

Apologies if this has already been answered but whenever I try to run rake db:setup I get the following error
LoadError: Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (cannot load such file -- mysql2/mysql2)
I have tried installing the activerecord-mysql2-adapter gem but the error remains.
The adapters in my database.yml file are all mysql2
I am running Ruby 2.4.6p354 and Rails 3.2.22.5

@benfanderson Sorry for such a late reply... What operating system are you running?

@benfanderson @kaustubh-nair I've been encountering the same issue on my local system too(Mac OS Mojave user). All my adapters are mysql2 too and I've tried the other fixes found online but this issue just persists!

Hi @metonymic-smokey
I'm tagging @sashadev-sky here. I think she can help you out with Mac OS

@kaustubh-nair I'm facing an issue with the very last step, bundle exec passenger start , Ubuntu this time not Mac OS.
I'd used the link in the Installation and generated two keys(these keys were my second or third attempt at setting Mapknitter up) and copied them in the recaptcha.rb file.
However, when I run passenger start, I encounter this error:
App 25409 output: Error: The application encountered the following error: uninitialized constant Recaptcha::ClientHelper (NameError)
I've tried the usual methods of searching and trying to resolve this but they didn't seem to work, so I thought I'd ask here.
Thanks!

@metonymic-smokey Can you confirm that you are on the main branch?
And also make sure you have the latest changes by running git pull origin main?
And then install gems by running bundle install
If you still encounter the issue let me know
THanks!

@kaustubh-nair @gauravano @jywarren I was on the main branch, pulled the latest changes and ran bundle install too.
On running, bundle exec passenger start, I got a different error this time:
ActiveRecord::SchemaMigration Load (1.1ms) SELECT schema_migrations.* FROM schema_migrationsActiveRecord::PendingMigrationError ( Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development.
I ran bin/rake db:migrate RAILS_ENV=development as suggested in the error message.
I got this error on doing the above:
Mysql2::Error: BLOB, TEXT, GEOMETRY or JSON column 'styles' can't have a default value: CREATE TABLE `maps` (`id` int(11) auto_increment PRIMARY KEY, `name` varchar(255) DEFAULT '', `lat` decimal(20,10) DEFAULT 0, `lon` decimal(20,10) DEFAULT 0, `zoom` decimal DEFAULT 0.02, `version` int(11) DEFAULT 1, `password` varchar(255) DEFAULT '', `styles` text DEFAULT '', `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB .
I also followed this answer and also changed the RAILS_ENV in mapknitter.env to 'development'.
I tried to migrate again but got the same errors as earlier.

Thanks!

Hey @metonymic-smokey, changing the sql mode is one way. There's another way: copy the content of schema.rb.example and using it create a new file schema.rb. After that, try running rake db:migrate.

@gauravano @kaustubh-nair Thanks a lot for all the help! I have it installed locally on my system all thanks to your suggestions :)
When it is running, the terminal displays this message: ActiveRecord::SchemaMigration Load (27.9ms) SELECT `schema_migrations`.* FROM `schema_migrations` , is this something I should be concerned about to try and fix or just let things run as is?

Thanks once again!

ActiveRecord::SchemaMigration Load (27.9ms) SELECT schema_migrations.* FROM schema_migrations

It's normal and you shouldn't bother about this. Rails is just checking if there are any pending migrations to run or not. As you're not getting any error/warning, means there is no migration pending.

@benfanderson @metonymic-smokey did you guys receive these errors after following the instructions in https://github.com/publiclab/mapknitter/blob/main/MYSQL.md?

@kaustubh-nair @alaxalves LoadError: Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (cannot load such file -- mysql2/mysql2) is there any way we can customize this error message to LoadError: cannot load such file -- mysql2/mysql2. Do not gem install activerecord-mysql2-adapter, instead try____

@sashadev-sky Yes, I initially did follow those instructions for Mac OS but wasn't able to set it up locally.
I then switched to Ubuntu and managed to set it up with help from the community, again after following the mysql instructions and debugging a bit on my own.
Thanks!

@metonymic-smokey could you tell us at which step, instructions need more clarity or the commands didn't work out well for Mac OS?

@gauravano As I said above, whenever I attempted to run rake db:setup,I got an error with my adapters, even though on checking all of them in the database.yml file were mysql2 already.
I tried changing them to mysql but the error persisted.

Hmm, ok. Thank you for details. We'll certainly try to make our installation process easier and faster.

Hi! I'm installing this repo on a fresh Ubuntu installation. Everything worked very smoothly until I tried to start up the server, I'm getting an error specifiying a problem with bootsnap.

bundle exec rails s => Booting Puma => Rails 5.2.3 application starting in development => Run rails server -hfor more startup options W, [2019-10-07T11:16:23.731693 #29885] WARN -- Skylight: [SKYLIGHT] [4.1.2] Running Skylight in development mode. No data will be reported until you deploy your app. (To disable this message for all local apps, runskylight disable_dev_warning.) Exiting /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/yaml.rb:50:in fetch': No such file or directory - bs_fetch:open_current_file:open (Errno::ENOENT)
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/yaml.rb:50:in block in install!' from /home/natalie/Dev/Ruby/public-lab/mapknitter/config/initializers/load_config.rb:1:in

'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in load' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in load'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in block in load' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in load' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:657:in block in load_config_initializer'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in instrument' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:656:in load_config_initializer'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:614:in block (2 levels) in <class:Engine>' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:613:in each'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:613:in block in <class:Engine>' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:32:in instance_exec'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:32:in run' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:61:in block in run_initializers'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:228:in block in tsort_each' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:431:in each_strongly_connected_component_from'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:421:in block in each_strongly_connected_component_from' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:50:in each'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:50:in tsort_each_child' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:415:in call'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:415:in each_strongly_connected_component_from' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:349:in block in each_strongly_connected_component'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in each' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in call'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:347:in each_strongly_connected_component' from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:226:in tsort_each'
from /home/natalie/.rvm/rubies/ruby-2.4.6/lib/ruby/2.4.0/tsort.rb:205:in tsort_each' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:60:in run_initializers'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/application.rb:361:in initialize!' from /home/natalie/Dev/Ruby/public-lab/mapknitter/config/environment.rb:5:in '
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.1.2/lib/skylight/core/probes.rb:118:in require'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in require_relative'
from config.ru:3:in block in <main>' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/builder.rb:55:in instance_eval'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/builder.rb:55:in initialize' from config.ru:in new'
from config.ru:in <main>' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/builder.rb:49:in eval'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/builder.rb:49:in new_from_string' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/builder.rb:40:in parse_file'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/server.rb:319:in build_app_and_options_from_config' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/server.rb:219:in app'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in app' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/rack-2.0.7/lib/rack/server.rb:354:in wrapped_app'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in log_to_stdout' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:in start'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in block in perform' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in tap'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in perform' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/thor-0.20.3/lib/thor/command.rb:27:in run'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/thor-0.20.3/lib/thor.rb:387:in dispatch'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/command/base.rb:65:in perform' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/command.rb:46:in invoke'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/commands.rb:18:in <main>' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in block in require_with_bootsnap_lfi' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require_with_bootsnap_lfi' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in block in require' from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency'
from /home/natalie/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in require' from bin/rails:4:in '`

commented

Hi @nstjean, did u copy config/database.yml.example to config/database.yml and also db/schema.rb.example to db/schema.rb?

Hi, yes I copied and saved both of those.

commented

could u try starting the server with passenger. $ passenger start

Here's the screenshot of the errors I got trying passenger start and passenger start --port 3001
natalie@natalie-ubuntu: ~-Dev-Ruby-public-lab-mapknitter_002

Hi, I'm having trouble setting up the project locally. When I try to run bundle exec rake db:setup its giving the following error

rake aborted!
Errno::ENOENT: No such file or directory - bs_fetch:open_current_file:open
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/yaml.rb:50:in `fetch'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/yaml.rb:50:in `block in install!'
/home/rs007/git/mapknitter/config/initializers/load_config.rb:1:in `<main>'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:657:in `block in load_config_initializer'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in `instrument'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:656:in `load_config_initializer'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:613:in `each'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/engine.rb:613:in `block in <class:Engine>'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/home/rs007/git/mapknitter/config/environment.rb:5:in `<main>'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/skylight-core-4.1.2/lib/skylight/core/probes.rb:118:in `require'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/home/rs007/.rvm/gems/ruby-2.4.6/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/home/rs007/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in `eval'
/home/rs007/.rvm/gems/ruby-2.4.6/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config => environment
(See full trace by running task with --trace)

I tried reinstalling mysql server still i'm getting the same error I'm stuck on this for 2 days now!

Hello, everyone, I'm having trouble setting up the project locally. When I try to run rails s to get the server running. I get this error: Could not find libxml-ruby-3.1.0 in any of the sources
Run bundle install to install missing gems. Then when I bundle install I get this error: ```
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/stefanosugbit/.rvm/gems/ruby-2.5.0/gems/libxml-ruby-3.1.0/ext/libxml

/Users/stefanosugbit/.rvm/rubies/ruby-2.5.0/bin/ruby -I /Users/stefanosugbit/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0 -r ./siteconf20191011-12959-rqd4ud.rb extconf.rb
/Users/stefanosugbit/.rvm/rubies/ruby-2.5.0/bin/ruby: warning: shebang line ending with \r may cause problems
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/stefanosugbit/.rvm/rubies/ruby-2.5.0/bin/$(RUBY_BASE_NAME)
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
extconf failure: need libxml2.

Install the library or try one of the following options to extconf.rb:

  --with-xml2-config=/path/to/xml2-config
  --with-xml2-dir=/path/to/libxml2
  --with-xml2-lib=/path/to/libxml2/lib
  --with-xml2-include=/path/to/libxml2/include

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/stefanosugbit/.rvm/gems/ruby-2.5.0/extensions/x86_64-darwin-18/2.5.0/libxml-ruby-3.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/stefanosugbit/.rvm/gems/ruby-2.5.0/gems/libxml-ruby-3.1.0 for inspection.
Results logged to /Users/stefanosugbit/.rvm/gems/ruby-2.5.0/extensions/x86_64-darwin-18/2.5.0/libxml-ruby-3.1.0/gem_make.out

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

In Gemfile:
right_aws_api was resolved to 0.3.5, which depends on
right_cloud_api_base was resolved to 0.2.6, which depends on
libxml-ruby

commented

Hi @nstjean @blurry-x-face , did you get your issues fixed yet? @stefanosu try running gem install libxml-ruby -v '3.1.0' --source 'https://rubygems.org/'

@cesswairimu Yea I tried that and I still get that same error. :(

commented

Did you have ruby and rails working well in your environment before?

No, I didn't have ruby and rails working in my environment before. I made the changes to the code in the browser.

Hi @nstjean @blurry-x-face , did you get your issues fixed yet? @stefanosu try running gem install libxml-ruby -v '3.1.0' --source 'https://rubygems.org/'

No, I didn't

I got mine running today!!

commented

Great @nstjean, do you mind please posting your solution? I believe @blurry-x-face was facing the same problem...or in future anyone might get the same prob. Thanks

commented

@blurry-x-face which OS are you using?

commented

@stefanosu I believe you are running on linux right?

commented

@stefanosu try running this sudo apt-get install libxslt-dev libxml2-dev after it succeeds try doing bundle install again

I'm running on mac OS.

commented

ooh cool...should work for Mac too please try the command ☝️

@cesswairimu Sure!

First I made sure the config files were properly copied, renamed, and saved. I think one of mine might have been incorrect.
I double checked my re-captcha keys, those were ok.
I re-installed assets with yarn install
Then I tried bundle exec rails s again and it didn't give me an error.

I'm guessing something in database.yml or config.yml were wrong.

I tried running it says command not found and I also tried to add this extension to it STATIC_DEPS=true sudo pip install lxml