-
Notifications
You must be signed in to change notification settings - Fork 190
Error building therubyracer/libv8 on FreeBSD 9 (and a solution) #158
Comments
Thanks for the fix, it worked for me too. Hope the change required to libv8 will be applies soon. Cheers Guy |
It seems that there is a conflict when you have v8 installed in your system already. Here is what I did to get closer to installing therubyracer: Deinstall v8$ add -fPIC into the freebsd section of SConstruct as you indicated aboveRun scons with x64 arch$ This compiles, but when I run Any way to get therubyracer to use the system shared v8? |
@eddanger : @turgu1 :
Moreover, if I remermber well my last tests (I cannot recheck right now, but it can be done later if necessary), the "gem install libv8" is building it nicely. |
@jlc: My context of use is the following: I'm developing a Ruby on Rails document management application that uses Twitter Bootstrap to build the HTML/Javascript front-end. As bootstrap uses Less as a pre-processing language to produce CSS, it requires therubyracer to support the Less compiler. To integrate bootstrap, I use the twitter-bootstrap-rails gem. Everything goes well under OSX (my development environment) but when I deploy through Capistrano on the targeted FreeBSD production server, I get compiling errors from the bundle process during deployment. On both the development and deployment environment, I use the last stable Ruby version 1.9.3, Ruby on Rails version 3.2.3, RVM to manage the ruby interpreter and PostgreSQL as the database backend (of course, Capistrano to automate the deployment). Under OSX, therubyracer seems to install a binary version of the libv8 gem(no source found on my development system). Under FreeBSD, the version seems to be related to http://github.com/fractaloop/libv8, but I can't get access to it through github. The Capistrano process make bundler run and put all gems required by the application at the following place:
where I found the libv8-3.3.10.4 directory. Using your recipe, I managed to compile libv8.a and make it available to the complete the deployment process. The bundle process didn't tried to compile it again as it was there. But still, I get runtime errors. Hope all this help! Cheers! Guy |
Thanks, jlc. While extracting your workaround, I turned it into a script for my own documentation purposes and others who might find it useable. https://gist.github.com/2621916 Note that this is for a RVM based installation. Amend the paths according to your setup. |
@GSI slightly modified for my setup allows me to install: https://gist.github.com/2623519 But I'm getting a Core dump when using therubyracer in my projects. |
I created fork that should works I tested it on freebsd 8.x |
@madmax thank you, thank you, thank you! |
@madmax thank you for building this but unfortunately libv8-freebsd does not seem to compile for me on FreeBSD 9 amd64, doing a gem install libv8-freebsd --verbose I have the following error: scons: warning: Ignoring missing SConscript 'obj/test/release/SConscript' |
Hmm, I tested it on Freebsd 8.2 and 8.1. Did you have ports/lang/v8 installed? If yes try uninstall it. Try gem unpack libv8-freebsd What version gcc it use? For me it is |
@madmax removed the v8 port and have libv8-freebsd and therubyracer-freebsd installed, thanks. |
@madmax So, I was able to get these installed under FreeBSD 9.0, but the issue now is that my Rails project uses the Assets pipeline and I see this in my Gemfile.lock:
I was able to get around this by manually renaming my installed gems to pose as therubyracer and libv8 (ie. remove the -freebsd), but this doesn't seem like a great solution. And when running it, I get a similar coredump to @eddanger: /usr/local/lib/ruby/gems/1.9/gems/therubyracer-freebsd-0.10.1/lib/v8/portal.rb:16: [BUG] Stack consistency error (sp: 309, bp: 310) :( |
@pgib please update less and it should works just fine. You can also use gem 'therubyracer', git: "git://github.com/madmax/therubyracer-freebsd.git" But this old less version require old therubyracer and still it will not work, i suggest update less. About [BUG] i have no idea, i'm not C guy :) |
therubyracer and libv8 builds have been updated on master to fix this and other issues. |
Hey Charles,
I came across a building issue of the libv8 gem while installing gitlab in a FreeBSD jail, and would like to share the problem and the solution I have found with you and anyone who might be interested.
The big picture:
a) this is the first time ever I'm getting close to ruby, RoR, gem...etc. Excuse me if I'm missing something somewhere.
b) uname -a : FreeBSD 9.0-RELEASE #0 amd64
c) gcc --version: gcc (GCC) 4.2.1 20070831 patched [FreeBSD]
d) requirement: make gitlab work :)
After I have understood that therubyracer is using a special version of libv8, and that we should not use the one provided by ports (/usr/ports/lang/v8), I tried to run
Which gently install the libv6, however:
Says:
After few mistake (certainly due the lack of sleep...) between the 2 set of code in:
and
I continued with:
Which produces:
Googling this issue point to:
http://code.google.com/p/v8/issues/detail?id=744
Which say:
Great! This nicely build libv8.a!
However,
Says:
We then need to add -fPIC into the freebsd section of
Rebuild libv8:
Install therubyracer
Which, finally, says:
I hope it has been clear enough for you to fix it.
If you need any tests / help : jl@lo.cx
Wish you a nice day,
Jeanluc
The text was updated successfully, but these errors were encountered: