warnings being treated as errors in rails - ruby-on-rails

I have the following error when i try to make "bundle install" in my rails projects
C:/Ruby22/bin/ruby.exe -r ./siteconf20150427-5772-lng4pk.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating byebug-i386-mingw32.def
compiling breakpoint.c
cc1.exe: warnings being treated as errors
In file included from c:/Ruby22/include/ruby-2.2.0/ruby/defines.h:163:0,
from c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:29,
from c:/Ruby22/include/ruby-2.2.0/ruby.h:33,
from ./byebug.h:4,
from breakpoint.c:1:
c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:319:44: error: 'struct timespec' declared inside parameter list
c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:319:44: error: its scope is only this definition or declaration, which is probably not what you want
c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:320:43: error: 'struct timespec' declared inside parameter list
make: *** [breakpoint.o] Error 1
make failed, exit code 2
i'm on windows 7, after research a lot, i find that i have to unset the option of take warnings as errors. Anyone knows where i can unset such option (in the makefile isn't possible because the makefile is a generated file)

This may not be what you want to hear. But I had this error a lot when I was developing RoR applications out of windows. I also had a plethora of other issues that have nothing to do with rails, and more to do with how Ruby interacts with the Windows OS. Ruby is very "Linuxy" in it's nature. Because of this, I would recommend using a virtual machine running linux ubuntu when developing using Ruby and Rails.
There is a great linux virtual machine called "Vagrant". It has been wonderful to use Ruby in. They have documentation on how to get up and running with Ruby found here:
https://www.vagrantup.com/
I hope this helps. I know switching to the Vagrant virtual machine helped me solve a lot of these futile problems that had nothing to do with writing the actual code.

Related

Installed GLIB on MacOS using Homebrew but "... GLIB could not be found"

I tried to update my glib as part of flex, both installed using Homebrew on 10.14. However, when I config/make my flex project, I get:
*** The glib-config script installed by GLIB could not be found
*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GLIB_CONFIG environment variable to the
*** full path to glib-config.
I assume the problem is that last bit, so I did...
export GLIB_CONFIG=/usr/local/lib/glib-2.0/include
And get the same error. I also tried adding /glibconfig.h to the end, but that does the same.
Looking in config.log I see a different issue:
configure:1696:10: fatal error: 'glib.h' file not found
I assume the two are related of course, but I'm thinking the root issue is the later. Does anyone know where this file is and what envar it might be using to find it?

I have issues starting a Ruby on Rails project

I'm starting a new project but I have issues installing sqlite3 on my computer. What is the problem?
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190428-9612-10i9sod.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... no
checking for dlopen()... no
missing function dlopen
*** 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.
I have already installed Ruby, Rails, Bundle. But apparently, something is missing.
I had this error on my win7, and this was my solution:
type ridk exec pacman -S mingw-w64-x86_64-dlfcn and install
This should work if your install ruby in 'common' way. Like 'rubyinstaller'.
You can consider skipping SQLite altogether. The only reason Rails is setup for SQLite by default is that its easy to setup up on most systems. If not then its mostly a waste of time.
Its not really a viable option for deployment as its file based. This is especially if you want to deploy to cloud platforms such as Heroku which use ephemeral file systems.
You will want to develop and test on the same database that you are going to deploy to such as Postgres.
Differences between backing services mean that tiny incompatibilities
crop up, causing code that worked and passed tests in development or
staging to fail in production. These types of errors create friction
that disincentivizes continuous deployment. The cost of this friction
and the subsequent dampening of continuous deployment is extremely
high when considered in aggregate over the lifetime of an application.
https://12factor.net/dev-prod-parity

opencv-3.3.0 Stops compiling at 58%

I'm compiling opencv for Rasbian Stretch, running on the Pi 3b.
It compiled all the way to 58% before outputting this error.
Anybody familiar with the error and how to correct it?
[58%]Linking CXX shared library ../../lib/libopencv_datasets.so
CMakeFiles/opencv_datasets.dir/src/gr_chalearn.cpp.o: file not recognized: File truncated
collect2: error: id returned 1 exit status
modules/datasets/CMakeFiles/opencv_datasets.dir/build.make:858: recipe for target 'lib/libopencv_datasets.so.3.3.0' failed
make[2]: * [lib/libopencv_datasets.so.3.3.] Error 1
CMakeFiles/Makefile2:14481: recipe for target 'modules/datasets/CmakeFiles/opencv_datasets.dir/all' failed
make[1]: * [modules/datasets/CMakeFiles/opencv_datasets.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make *** [all] Error 2
I solved this issue by downloading opencv-3.4 and running make with -j4
Building OpenCV binaries on officially supported Ubuntu/Linux based operating systems has always been a little more troublesome than normal images. One of the core reasons is the visual graphics (mostly, but not limited to) used by these distributions are different than general ones. You'll find some similar errors while installing it on LXDE based Ubuntu distributions, for the same reason. I spotted different errors for the same method on Ubuntu 18.04 Gnome, Ubuntu 18.04 LXDE, Ubuntu 16.04 LXDE, and Raspbian OS. Having said that, there are always solutions available.
Please check this link for libraries required. Make sure you have all the repositories added which are required for installation. You must look extremely carefully for these libraries:
libgsteramer1.0-dev, libgstreamer1.0-plugins-base-dev & libgstreamer1.0-base-dev.
libprotobuf-dev & protobuf-compliler
libatlas-base-dev
libjasper-dev (this one for wheezy, you'll need to enable repository)
libfaac-dev
These libraries will be required and a test will run on them during CMake. Some of them have a lot of dependency issues like libpng-dev and libtheora-dev. If you can paste the initial part of your CMake build, we can pin-point those libraries.

Xilinx error while compiling hello world, missing library - Ubuntu 14.04

I'm am pretty new with Xilinx, so it might be a simple problem.
I'm am trying to make a program written in c, with the editor xsdk for a microblaze, I'm am running Ubuntu 14.04 64 bit.
When I'm trying to compile the c program i comes with an error:
/opt/Xilinx/14.7/ISE_DS/EDK/gnu/microblaze/lin/bin/../lib/gcc/microblaze-xilinx-elf/4.6.4/../../../../microblaze-xilinx-elf/bin/as:
error while loading shared libraries: libz.so.1:
cannot open shared object file: No such file or directory
make: *** [src/helloworld.o] Error 1
The program I'm trying to compile is the standard example hello world, so this should not course any problems.
Any help would be appreciated
It seems like installing the package rpm fixed the problem - honestly i don't know why.

How can I test my external API calls without having to push my code changes to my Ruby on Rails application?

Question Rephrase:
Can I configure my local web server to be connected to the public internet so that I can test my API calls locally?
Details: (edited)
I'm still looking for some help on this. It seems that there is a compatibility issue from what I can gather from many Google searches. Has anyone out there used the gem Proxylocal on a Windows machine? Did you need to perform any extra steps to get it to work because you were on a Windows machine?
I am using Ruby on Rails and Heroku for deployment.
I was pointed to Pow (pow.cx), but this only works on macs. I am running Windows 8. Does anyone have a suggestion for me? Thanks!
Update:
I was unable to install the proxylocal gem. I receive the following error upon entering gem install proxylocal in my command line prompt:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing proxylocal:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
make
generating decode-i386-mingw32.def
compiling decode.c
decode.c:3:24: fatal error: netinet/in.h: No such file or directory
compilation terminated.
make: *** [decode.o] Error 1
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bert-1.1.6 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bert-1.1.6/ext/bert/c/gem_make.out
And this is the contents of gem_make.out:
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
make
generating decode-i386-mingw32.def
compiling decode.c
decode.c:3:24: fatal error: netinet/in.h: No such file or directory
compilation terminated.
make: *** [decode.o] Error 1
Does anyone have an idea of what might be the issue here? I don't see any spaces in the paths I have my gems installed in, which seems to be a common cause to this error for a lot of people...
You can try the proxylocal gem
I was facing the same issue, but I found that, it's not proxylocal's problem, it's bert's problem, see the error log:
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bert-1.1.6 for inspection.
It's because with bert distribution, linux headers are being provided, I have posted here a solution for the same after testing it on my windows system. Please have a look and let me know, it you were able to solve it or not!

Resources