Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Unable to install on OS X 10.11.4 with Ruby 2.2.4 #405

Closed
Geesu opened this issue Apr 4, 2016 · 18 comments
Closed

Unable to install on OS X 10.11.4 with Ruby 2.2.4 #405

Geesu opened this issue Apr 4, 2016 · 18 comments

Comments

@Geesu
Copy link

Geesu commented Apr 4, 2016

I'm just simply trying to run gem install therubyracer and I'm receiving the following errors:

/Users/graceficke/.rbenv/versions/2.2.4/bin/ruby -r ./siteconf20160404-60041-1d63bmg.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
checking for main() in -lv8... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:360:33: error: use of undeclared identifier 'nullptr'
  V8_INLINE MaybeLocal() : val_(nullptr) {}
                                ^
/usr/local/include/v8.h:367:51: error: use of undeclared identifier 'nullptr'
  V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                                  ^
/usr/local/include/v8.h:371:29: error: use of undeclared identifier 'nullptr'
    out->val_ = IsEmpty() ? nullptr : this->val_;
                            ^
/usr/local/include/v8.h:437:50: error: use of undeclared identifier 'nullptr'
  bool IsFirstPass() const { return callback_ != nullptr; }
                                                 ^
/usr/local/include/v8.h:808:42: error: use of undeclared identifier 'nullptr'
  V8_INLINE Global() : PersistentBase<T>(nullptr) {}
                                         ^
/usr/local/include/v8.h:833:18: error: use of undeclared identifier 'nullptr'
    other.val_ = nullptr;
                 ^
/usr/local/include/v8.h:845:18: error: use of undeclared identifier 'nullptr'
      rhs.val_ = nullptr;
                 ^
/usr/local/include/v8.h:1110:52: error: use of undeclared identifier 'nullptr'
                            ScriptOrigin* origin = nullptr));
                                                   ^
/usr/local/include/v8.h:1113:30: error: use of undeclared identifier 'nullptr'
      ScriptOrigin* origin = nullptr);
                             ^
/usr/local/include/v8.h:3242:36: error: use of undeclared identifier 'nullptr'
    return NewInstance(context, 0, nullptr);
                                   ^
/usr/local/include/v8.h:4457:57: error: use of undeclared identifier 'nullptr'
      experimental::FastAccessorBuilder* fast_handler = nullptr,
                                                        ^
/usr/local/include/v8.h:4473:57: error: use of undeclared identifier 'nullptr'
      experimental::FastAccessorBuilder* fast_handler = nullptr);
                                                        ^
/usr/local/include/v8.h:7292:27: error: use of undeclared identifier 'nullptr'
  if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
                          ^
In file included from accessor.cc:1:
./rr.h:358:39: error: no member named 'ScriptData' in namespace 'v8'
class ScriptData : public Pointer<v8::ScriptData> {
                                  ~~~~^
./rr.h:358:51: error: expected class name
class ScriptData : public Pointer<v8::ScriptData> {
                                                  ^
./rr.h:360:21: error: no type named 'ScriptData' in namespace 'v8'; did you mean simply 'ScriptData'?
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                    ^~~~~~~~~~~~~~
                    ScriptData
./rr.h:358:7: note: 'ScriptData' declared here
class ScriptData : public Pointer<v8::ScriptData> {
      ^
./rr.h:360:54: error: no member named 'ScriptData' in namespace 'v8'
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                 ~~~~^
./rr.h:360:65: error: expected class member or base class name
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                                ^
./rr.h:360:65: error: expected '{' or ','
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

make failed, exit code 2

I have tried the following as well, but it is the same error:

brew tap homebrew/versions
brew install v8-315
brew link --force v8-315
gem install libv8 -- --with-system-v8
gem install therubyracer``` 
@desireco
Copy link

I have the same problem. I tried number of things, including reinstalling all rubies, as well as different combination of libv8 and rubyracer as it seems that interface has changed. However I was not succesfull figuring this out.

@Geesu
Copy link
Author

Geesu commented Apr 10, 2016

What's odd is I was able to get it working with the above on MY macbook pro, and I have no idea why. This was after spending 2 hours trying to get it work on my co-worker's mac, which I still haven't been able to complete (hence the issue).

@desireco
Copy link

Same here. It works on my laptop, on desktop I just can't make it work and I was hoping during weekend to use bigger screen to work through some stuff. Both are with updated software. So I don't know. Wish I know where else to look.

@EricBoersma
Copy link

Also seeing this problem. Fresh install of El Capitan, can't install therubyracer.

@EricBoersma
Copy link

For those struggling with this, I was able to follow the steps included in the accepted answer on This StackOverflow question. Specifically the parts about using the 4.2.2 GCC for building libv8 in the bundler config. That workaround has worked for me.

@Geesu
Copy link
Author

Geesu commented Apr 11, 2016

Shux, I was really hoping that would do it @EricBoersma but I receive this error: https://gist.github.com/Geesu/5e93aec94ed4962dcbc85a8c509784fc

@im-kulikov
Copy link

brew tap homebrew/versions
brew install v8-315
brew link --force v8-315
gem install libv8 -- --with-system-v8
gem install therubyracer

solved my problem, thanx @Geesu

@Southern
Copy link

I was able to use this to finally get it working:

brew install v8-315
bundle config --local build.libv8 --with-system-v8
bundle config --local build.therubyracer --with-v8-dir=/usr/local/opt/v8-315
bundle install

@desireco
Copy link

Strangely, this solved my problem. Thank you. I kind of not sure why this would work and normal ways wouldn't. But happy it does work.

@Southern
Copy link

Yeah. It took me 2 days to figure this out. Tried all of the combinations in this issue with no luck, some from StackOverflow, and finally hit this one. Glad it helped.

@desireco
Copy link

Thank you. I think this solves it.

@avatsaev
Copy link

@im-kulikov yes this worked, thanks

@Geesu
Copy link
Author

Geesu commented Apr 13, 2016

Yes that did it!

@ronnietaylor
Copy link

#issuecomment-209169869 worked for me. Thanks!

@KudosX
Copy link

KudosX commented Apr 13, 2016

thanks southern!!
#issuecomment-209169869 worked for me with rails 5.0.0.beta3.
that was painful finding a solution.
I have no idea how you figured that one out but, sure glad you did!

@Southern
Copy link

It was pure luck. I just started working with Ruby/Rails like 3 days ago, and most of that time was spent looking for this solution.

Glad it's working for everyone though.

@haaayden
Copy link

Thank you!

@ignisf
Copy link
Collaborator

ignisf commented Apr 28, 2016

There has been a new release of libv8 that should address most OS X install issues. Closing for now.

@ignisf ignisf closed this as completed Apr 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants