WIth Ruby 187, I had downloaded devkit from http://rubyinstaller.org/downloads
and followed the instruction per https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
I had also ensured that devkit is installed properly by following
smoke test.
I had then tried installing bluecloth (v2.0.10). It had failed with
following error:
C:\test\typo>gem install bluecloth --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing bluecloth:
ERROR: Failed to build gem native extension.
c:/Ruby187/bin/ruby.exe extconf.rb
checking for srand()... yes
checking for random()... no
checking for rand()... yes
checking for bzero() in string.h,strings.h... no
checking for strcasecmp()... yes
checking for strncasecmp()... yes
checking for mkdio.h... yes
checking for ruby/encoding.h... no
creating extconf.h
creating Makefile
make
gcc -I. -I. -Ic:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -
DRUBY_EXTCONF_H=\"extcon
f.h\" -DVERSION=\"2.0.4\" -g -O2 -DFD_SETSIZE=256 -I. -Wall -c
bluecloth.c
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/windows.h:48:0,
from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/winsock2.h:22,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/win32/
win32.h:27,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/defines.h:
186,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/ruby.h:37,
from bluecloth.h:14,
from bluecloth.c:25:
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:229:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: two or more data types in declaration
specifiers
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:241:24: error: duplicate 'unsigned'
bluecloth.c: In function 'bluecloth_initialize':
bluecloth.c:190:9: warning: unused variable 'utf8text'
make: *** [bluecloth.o] Error 1
Gem files will remain installed in c:/Ruby187/lib/ruby/gems/1.8/gems/
bluecloth-2.0.10 for inspection.
Results logged to c:/Ruby187/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/
ext/gem_make.out
C:\test\typo>
If you need 2.2.0 (the latest version), here's how I got it to work:
Install DevKit
Run the command below to install bluecloth:
gem install bluecloth
this will fail miserably when building "native extensions", but will successfully install the gem's source code.
Patch bluecloth.h file (for me, this is found in: D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext), with the patch from here: https://gist.github.com/1539611
Go to bluecloth's gem installation folder. For me, this looks like below:
D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0
Run the following command:
rake gem
It may prompt you to install some other gems, follow accordingly.
When it's done, you should see a bluecloth-2.2.0.gem created. For me, it is found here:
D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem
Go to bluecloth-2.2.0.gem location, and run the following command:
gem install bluecloth-2.2.0.gem --platform=ruby
It seems there is a bug/issue with version 2.0.10 of BlueCloth. You can try using an older version like 2.0.7:
gem install bluecloth -v 2.0.7
Which seems to work.
Also probably this worth checking latest version (2.2.0?) and if not work, report it back to gem author:
http://deveiate.org/projects/BlueCloth/query
This is the patched bluecloth.h code, for people in a hurry...
#ifndef BLUECLOTH_H
#define BLUECLOTH_H
#include "ruby.h"
#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
# define M17N_SUPPORTED
# include "ruby/encoding.h"
#endif
#include "config.h"
#include "assert.h"
#include "mkdio.h"
void mkd_initialize _(( void ));
void mkd_with_html5_tags _(( void ));
/* Replace the macro from encoding.h that refers to static 'rb_encoding_list' */
#ifdef ENC_FROM_ENCINDEX
#undef ENC_FROM_ENCINDEX
#define ENC_FROM_ENCINDEX(idx) (rb_enc_from_index(idx))
#endif
#endif
There's a fork on github that already includes the patch:
https://github.com/drakontia/bluecloth
Related
I was trying to install "iRF" in R.
Here is the error:
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [ExportedFunctionsRIT.o] Error 127
ERROR: compilation failed for package ‘iRF’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/iRF’
And when I turned into the terminal to see my g++ and gcc, I found them in a different path:
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I never faced this before. I was trying to install gfortran and this error came when I installed xcode and gcc again. I'd appreciate it if someone could help me fix this. By the way, if you know how to install gfortran to deal with the compline error in installing packages form gihub, that would be nice.
Thanks!
When installing the blurrily gem, I get the following issue.
For reference I'm using:
rvm 1.29.1
ruby 2.1.7p400
rails 3.2.22.5
And I'm trying to install Blurrily 1.0.2.
The error:
/Users/jonkeenan/.rvm/rubies/ruby-2.1.7/bin/ruby -r ./siteconf20170525-
62993-1jexk35.rb extconf.rb
creating Makefile
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR=" clean
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR="
compiling map_ext.c
compiling search_tree.c
compiling storage.c
storage.c:283:43: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
if (haystack->refs) blurrily_refs_free(&haystack->refs);
^~~~~~~~~~~~~~
storage.c:405:24: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
blurrily_refs_new(&haystack->refs);
^~~~~~~~~~~~~~
2 errors generated.
make: *** [storage.o] Error 1
make failed, exit code 2
It looks like a c compile issue, but I'm not sure.
I'm running a version of xcode that's using Apple LLVM version 8.1.0 (clang-802.0.42) if that helps.
Unfortunately, it appears that this is a known issue that the gem maintainers have not yet addressed.
As a workaround, it might be worthwhile to switch to a Vagrant/Docker development workflow until this is addressed upstream.
I am trying to compile Erlang OTP-R16B03-1 on FreeBSD 10.1 OS. When i run the ./configure command the output is
odbc : ODBC library - header check failed
I have tried installing unixODBC, iODBC. Also /usr/ports/databases/unixODBC exists. The sql.h file is located in /usr/local/include.
I am still getting the link failed error. Any help will be useful
The log for ./configure |grep odbc command is as shown below
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
=== configuring in odbc/. (/root/otp_src_R16B03-1/lib/odbc/.)
checking for odbc in standard locations... -L/usr/local/lib
checking for SQLAllocHandle in -lodbc... no
configure: WARNING: "ODBC library - header check failed"
configure: WARNING: Check for large file support flags failed; getconf failed
odbc : ODBC library - header check failed
I had the same problem on erlang 21 but when I downloaded the newest version from github (erlang 22), and tried ./configure the error ODBC library - header check failed appeared again but after trying make install again, everything finished successfully.
What finally worked for me was
apt-get install unixodbc-dev
Then
otp_build configure --with-odbc=/usr/lib/x86_64-linux-gnu/
I have tried to compile Mosquitto on both Arch and CentOS 7, but everytime I get the same error. I want to test the Websocket feature.
This is the procedure I am using for CentOS:
yum group install "Development Tools"
yum install cmake openssl-devel cmake
yum install uuid-devel libxslt docbook5-style-xsl.noarch docbook-style-xsl.noarch
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets/
mkdir build;cd build
cmake ..
make
make install
git clone https://git.eclipse.org/r/mosquitto/org.eclipse.mosquitto
cd org.eclipse.mosquitto/
git checkout origin/1.4
vi config.mk
Change "WITH_WEBSOCKETS:=yes"
make
And this is where it dies on Arch and CentOS:
make[1]: Entering directory '/home/install/org.eclipse.mosquitto/src'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -DVERSION="\"1.4\"" -DTIMESTAMP="\"2015-05-04 17:17:55+0200\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_WEBSOCKETS -DWITH_EC -c mosquitto.c -o mosquitto.o
In file included from /usr/include/unistd.h:25:0,
from mosquitto.c:22:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
mosquitto.c: In function ‘main’:
mosquitto.c:275:101: error: expected expression before ‘,’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP);
mosquitto.c:290:54: error: expected expression before ‘)’ token
snprintf(buf, 1024, "mosquitto version %s", VERSION);
mosquitto.c:368:88: error: expected expression before ‘)’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s terminating", VERSION);
Makefile:15: recipe for target 'mosquitto.o' failed
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory '/home/install/org.eclipse.mosquitto/src'
Makefile:21: recipe for target 'mosquitto' failed
make: *** [mosquitto] Error 2
If someone can please point out what I am doing wrong or missing ?
As #hardillb says, the VERSION defines are the problem. If I add the line
#define VERSION
to mosquitto.c, then I can reproduce the error that you see, but also get a warning about redefining VERSION.
If I remove the definition of VERSION from config.mk, then I get an error about VERSION not being defined.
These both make sense.
What seems to be happening for you is that the compiler is ignoring the command line definition -DVERSION="\"1.4.1\"" and replacing it with -DVERSION=, or isn't parsing the string properly. This doesn't make sense.
Other people have managed to compile on Arch, and the CentOS7 repository has a binary version - but without websockets.
After some investigation, it appears as though there is a bug in recent libwebsockets code. This changeset introduces some changes that mean that libwebsockets is claiming the macro VERSION all for itself, which isn't very polite for a library. If you use a released version of libwebsockets you should not have any problem compiling.
Just out of interest have you tried building from the TGZ src bundle for Mosquitto 1.4.1 available here:
http://mosquitto.org/download/
The errors look to be something to do with expanding the passed in VERSION and TIMESTAMP values. It builds fine [with the exception of the docs] on Fedora 20 which shouldn't be that far from RHEL 7.0 (and from there to Centos 7).
Here is what I ran:
rvm install ruby-1.9.2-p290
I have xCode 4 installed. And I am running OSX 10.6.7
Here is the error I get
ruby-1.9.2-p290 - #configuring
ERROR: Error running ' ./configure --prefix=/Users/jac/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jac/.rvm/usr ', please read /Users/jac/.rvm/log/ruby-1.9.2-p290/configure.log
ERROR: There has been an error while running configure. Halting the installation.
Here are the last parts of the log file
checking for working volatile... yes
checking whether right shift preserve sign bit... yes
checking read count field in FILE structures... _r
checking read buffer ptr field in FILE structures... _p
checking size of struct stat.st_ino... SIZEOF_LONG
checking whether _SC_CLK_TCK is supported... yes
checking stack growing direction on i386... -1
checking for backtrace... yes
checking whether ELF binaries are produced... no
checking whether OS depend dynamic link works... yes
checking for strip... strip
configure: error: thread model is missing
I'll tell ya I never post question anywhere because I can usually figure stuff out eventually. But I am not seeing anyone having this specific error anywhere. I see similar things about not having XCode... But I have that.
EDIT:
I ran into this problem because I thought I had everything set up but when I tried to make a new project I ran into this:
rails new demo
/Library/Ruby/Site/1.8/rubygems/dependency.rb:247:in to_specs': Could not find rails (>= 0) amongst [rake-0.8.7, rake-0.8.7] (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:256:into_spec'
from /Library/Ruby/Site/1.8/rubygems.rb:1195:in `gem'
from /usr/bin/rails:18
Are you missing /usr/include/pthread.h on your system?