Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while installing the gem in teminal-less environment #112

Closed
ghost opened this issue Nov 1, 2013 · 5 comments
Closed

Exception while installing the gem in teminal-less environment #112

ghost opened this issue Nov 1, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 1, 2013

If "gem install xcodeproj" is launched by the process which doesn't have a terminal associated with it the following error occurs:

Error installing xcodeproj:
    ERROR: Failed to build gem native extension.      
rake RUBYARCHDIR=/Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0/ext RUBYLIBDIR=/Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0/ext 
rake aborted! 
Device not configured - /dev/tty 
/Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0/ext/xcodeproj/Rakefile:26:in `initialize' 
(See full trace by running task with --trace) 
(in /Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0/ext/xcodeproj)   

Gem files will remain installed in /Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0 for inspection. Results logged to /Users/hoha/.gem/ruby/1.8/gems/xcodeproj-0.14.0/ext/xcodeproj/gem_make.out 
Building native extensions.  This could take a while...

I can only reproduce this with Ruby 1.8.7 (which is a standard one for Mountain Lion) but not with RVM's 1.9 or 2.0 . Looks like 1.8.7 returns true File.writeable?('/dev/tty') even if '/dev/tty' is not configured.

You can easily reproduce this by downloading RubyMine demo (http://www.jetbrains.com/ruby/) and trying to install xcodeproj 0.14.0 for 1.8.7 (Preferences | Ruby SDK and Gems)

This issue makes it hard to integrate xcodeproj (and dependent gems) with non-terminal applications. It's especially annoying that the offending line doesn't really do anything important.

@alloy
Copy link
Member

alloy commented Nov 1, 2013

Looks like 1.8.7 returns true File.writeable?('/dev/tty') even if '/dev/tty' is not configured.

Sigh. Sorry man, I was sure I had checked all differences. I’ll try get a fix out asap, I really want it to work with your IDEs.

It's especially annoying that the offending line doesn't really do anything important.

It’s important to us so we can recognise what people have installed when they paste their output. People are using so many different Ruby versions that we need a way to recognise what’s being done, this was the only way I could find that made it work with how RubyGems runs the ext build phase.

@ghost
Copy link
Author

ghost commented Nov 1, 2013

No problem!

And now when I understand why that log is there I agree that it's quite useful for debugging purposes. Maybe if TTY is not available you should write it to the build log or something.

@alloy
Copy link
Member

alloy commented Nov 1, 2013

Fixed by 11c7a7a and released as 0.14.1.

@alloy alloy closed this as completed Nov 1, 2013
@ghost
Copy link
Author

ghost commented Nov 13, 2013

Works great, thanks!

@alloy
Copy link
Member

alloy commented Nov 14, 2013

🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant