Socket warning RAILS 7 with chruby - ruby

I need help with this error messages shows when i am trying to start my Ruby on Rails 7 server or console, doesnt affect functionality but its annoying, I am also using Chruby 2.7.5 because server is running on this version compared to my default Ruby version.
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:208: warning: previous definition of BUFSIZE was here
/home/ubuntu20/.rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/home/ubuntu20/.gem/ruby/2.7.5/gems/net-protocol-0.1.2/lib/net/protocol.rb:504: warning: previous definition of Socket was here
Loading development environment (Rails 7.0.2.3)
Thanks for help or tips

It's a known problem (https://github.com/ruby/net-protocol/issues/10)
The solution that seems to work is to force-add net-http
bundle add net-http silenced this for me. Hope it helps.

Related

Ruby on Rail running apache show index of when accessing the site

I have recently updated to Apache 2.4, and I am using Ruby on Rail to run my application. Following the upgrade, the site shows a content as seen in the image below, and the error on the log file shows this error message. I have tried using the 'Bundle Install' and checked the permission but that hasn't helped. Any advice would be greatly appreciated. Thanks
[ 2022-02-07 07:47:24.5559 8104/7efc89c8f700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: ba7e6074
Error details saved to: /tmp/passenger-error-RA01E9.html
Message from application: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/gems/mysql2-0.3.14/lib/mysql2/mysql2.so (LoadError)
PassengerRuby /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/wrappers/ruby
SetEnv GEM_HOME /root/.gem/ruby/1.9.1
This error shows a problem with the shared objects. You probably updated MySQL/MariaDB libraries with Apache and new libraries are incompatible with your mysql2 gem build. The solution is simple:
First, ensure you are using the ruby-2.0.0-p353#hroot RVM environment.
Then, execute the following command:
gem install mysql2 --version 0.3.14
This should rebuild your mysql2 gem for the new MySQL/MariaDB client libraries on your system.
this isn't the answer anyway but another method to run ruby (in my case Windows 10 ; if you use another OS try to find out how to modify inside index.php the ruby starter)
i post here an alternative method to use apache + php +... and ruby
https://stackoverflow.com/a/71733656/5781320

Fault in reticulate in rstudio

476/5000
rstudio generates error when running R code with python code. At first the code worked very well but in the second installation it started to generate faults. Here is the link of the code in case you want to play #https: //www.r-bloggers.com/r-and-python-using-reticulate-to-get-the-best-of-both-worlds/
. My laptop is hp 4 gigs of ram and 500 mb of hard disk.
I would greatly appreciate who can explain the failure and how to solve it.
I have reinstalled anaconda last version twice.
library(reticulate)
use_python("/usr/local/bin/python")
use_virtualenv("r-reticulate")
os <- import("os")
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
os$listdir(".")
Error: object 'os' not found
py_config()
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
Actually, it comes from a deprecation warning reported a few days ago (fix compat import showing warning #8507).
But the fact is that this warning in "conda.compat" generates some errors, for example in the case of using conda environments in R through "reticulate" functions. This issue has been reported quite recently Conda warnings taken as errors #477.
The solution is to simply install the github version of "reticulate" in order to avoid these errors and ignore the conda warnings which shouldn't necessarily impede these functionalities. You can do it like this way:
remotes::install_github("rstudio/reticulate")
And don't forget to have the latest Rtools installed in your operating system!
This might be useful for you: https://docs.anaconda.com/anaconda/user-guide/tasks/switch-environment/
I have Anaconda, and set up Python 2 environment. Once activated, run 'use_python' with the path to that environment and set the 'required' parameter to TRUE.
I had the same problem. I solved the problem by installing an older version of conda.
In anaconda promt
conda install conda = 4.1.6

Error in sql_server package from community opscode

I am tring to install sql server in windows using chef
i found this sql_server
im getting an error
uninitialized constant Chef::Win32::Registry::HKEY_LOCAL_MACHINE
If you are running an older version of Chef client that does not have this constant defined, you will get this error.
See: http://lists.opscode.com/sympa/arc/chef/2014-01/msg00073.html
For me it helped to add :: in front of the constant to break out of any namespace, so it would look like this
::Chef::Win32::Registry::HKEY_LOCAL_MACHINE

Debugging Ruby-Code with Aptana

I'm trying to debug a ruby program using Aptana Studio 3.
When I start the deubgging, I get the following message in the console:
/var/lib/gems/1.9.1/gems/debugger-ide-0.0.2/lib/ruby-debug/command.rb:32: warning: already initialized constant DEF_OPTIONS
/var/lib/gems/1.9.1/gems/debugger-ide-0.0.2/bin/rdebug-ide:56: warning: already initialized constant ARGV
Fast Debugger (ruby-debug-ide 0.4.9) listens on :58828
Exception in DebugThread loop: undefined method `control' for Debugger::SkipCommand:Class
I'm using Stand-Alone Aptana-Studio 3.4.0 on Linux Mint 14 ("Nadia").

gem update sqlite3-ruby failed on Windows 7

This is the command I gave in command prompt:
gem install sqlite3-ruby > sqlite3-ruby.txt
This is the content of sqlite3-ruby.txt
Successfully installed sqlite3-ruby-1.2.5-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.5-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.5-x86-mswin32...
Rest of the command prompt was full of the following:
...
No definition for _wrap_sqlite3_value_text
No definition for _wrap_sqlite3_value_text16
No definition for _wrap_sqlite3_value_text16le
No definition for _wrap_sqlite3_value_text16be
No definition for _wrap_sqlite3_value_type
No definition for _wrap_sqlite3_result_blob
No definition for _wrap_sqlite3_result_double
No definition for _wrap_sqlite3_result_error
No definition for _wrap_sqlite3_result_error16
No definition for _wrap_sqlite3_result_int
No definition for _wrap_sqlite3_result_int64
No definition for _wrap_sqlite3_result_text
No definition for _wrap_sqlite3_result_text16
No definition for _wrap_sqlite3_result_text16le
No definition for _wrap_sqlite3_result_text16be
No definition for _wrap_sqlite3_result_value
No definition for _wrap_sqlite3_aggregate_context
...
While trying to create a database, I tried the following in command prompt:
rake db:create
A message box pops up saying that sqlite3.dll is missing. I need to reinstall the application. I tried gem update sqlite3-ruby command again and same thing happened.
How to resolve this issue? Thanks in advance.
This might be a silly answer, but did you install sqlite3?
http://www.sqlite.org/download.html
A message box pops up saying that sqlite3.dll is missing
Well, is it?

Resources