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

"No implicit conversion of nil into string" #72

Open
moverware opened this issue May 16, 2014 · 12 comments
Open

"No implicit conversion of nil into string" #72

moverware opened this issue May 16, 2014 · 12 comments

Comments

@moverware
Copy link

I receive this error simply when i type in Ocra into Cygwin

/cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/gems/ocra-1.3.1/bin/ocra:18:in `quote': no implicit conversion of nil into String (TypeError)
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/gems/ocra-1.3.1/bin/ocra:18:in `<class:Pathname>'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/gems/ocra-1.3.1/bin/ocra:8:in `<module:Ocra>'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/gems/ocra-1.3.1/bin/ocra:4:in `<top (required)>'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/bin/ocra:23:in `load'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/bin/ocra:23:in `<main>'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
        from /cygdrive/c/Users/mover96/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

any ideas?

@deanpcmad
Copy link

I'm getting this as well on Xubuntu 14.04. Ruby 2.0.0-p481

› be ocra --help    
/home/dean/Projects/brm/install-ruby/vendor/bundle/gems/ocra-1.3.2/bin/ocra:18:in `quote': no implicit conversion of nil into String (TypeError)
    from /home/dean/Projects/brm/install-ruby/vendor/bundle/gems/ocra-1.3.2/bin/ocra:18:in `<class:Pathname>'
    from /home/dean/Projects/brm/install-ruby/vendor/bundle/gems/ocra-1.3.2/bin/ocra:8:in `<module:Ocra>'
    from /home/dean/Projects/brm/install-ruby/vendor/bundle/gems/ocra-1.3.2/bin/ocra:4:in `<top (required)>'
    from /home/dean/Projects/brm/install-ruby/vendor/bundle/bin/ocra:23:in `load'
    from /home/dean/Projects/brm/install-ruby/vendor/bundle/bin/ocra:23:in `<main>'

@tralston
Copy link

I get the same error as @mover96. My script is very simple:

puts "Starting program..."
x = 5
puts x
x *= 4
puts x

@grauddi
Copy link

grauddi commented Dec 30, 2014

I also am receiving this error

@jesse1983
Copy link

I also am receiving this error.
OSX 10.10.1
RVM 1.26.9
Ruby 2.2.0

jgleesawn pushed a commit to jgleesawn/ocra that referenced this issue Jan 16, 2015
@jgleesawn
Copy link

This problem is coming about due to File::ALT_SEPARATOR having a value of nil. This seems to be the case on cygwin/msys2 systems despite them being in windows.
http://computer-programming-forum.com/39-ruby/7216d1ae1310e408.htm
There is the simple hacky fix to just stick a check in, but then you're circumventing the replacement that is supposed to happen. Which would not update any stored paths/filenames for calling purposes outside of a cygwin/msys environment?
Another possibility is to set an alt_separator variable and use that instead of using the system's constant value. If the program is being run from inside msys/cygwin, I don't know if the separator translation would affect how msys/cygwin treat/deal with files.

This is just supposed to fill out some information as to why its happening and some possible directions someone could look in to deal with it. I think other issues will arise after these simple changes and it may take some effort to get it working in cygwin/msys.

@jesse1983 and @deanperry in Problems and Bug Reporting it does say Windows Support only

@larsch
Copy link
Owner

larsch commented Jan 18, 2015

Only the Ruby from rubyinstaller.org are tested, and only native windows builds of Ruby is known to work. I have not made any effort to get Ocra working with any other platform than the rubyinstaller.org installers, so I don't even know if it is feasible.

@jgleesawn
Copy link

@larsch My latest update, if it doesn't break anything from the rubyinstaller side, allows a full run through/creation of a .exe under msys2. At least with the project I've been working with. Given, this .exe gives an Application error(0xc0000013) if run from an explorer folder, and has pathing issues for non-system requires when run from the terminal in msys2.

I'm not saying you should accept the pull request, but its there if anyone else uses msys2 and has some good ideas for how to fix these pathing issues.

P.S. I would assume this holds for cygwin as well.

larsch added a commit that referenced this issue Jan 18, 2015
@tille
Copy link

tille commented Jan 25, 2015

I don't think it's a cygwin issue since I'm getting the same error under ubuntu 14.04, with a helloWorld file.
touch ocraTest.rb && 'puts hello word' >> ocraTest.rb && ocra ocraTest.rb

@jgleesawn
Copy link

@tille cygwin/msys2 do not register as windows in ruby, so they don't have the File::ALT_SEPARATOR constant defined out of the box. This is also the case with Unix/Linux/OSX. I believe File::ALT_SEPARATOR is only defined in Windows because Windows uses the reverse slash as a path separator.

This combined with ocra only having support for Windows made me reference it as an issue in cygwin/msys2 being linux-like environments that run on windows.

edit: "No implicit conversion of nil into string" fix is in the repo's code but may not necessarily build an executable that runs when built from a non-windows platform. It may have to do with my usage of gems in non-typical locations. Could be due to some other implicit nature of the build environment. Could be I grabbed the exe stub from a different version because I couldn't get it to compile. I'm not really sure. Sorry for such an off-topic edit.

@ashes999
Copy link

@jgleesawn to be explicit, you can only run Ocra on Windows, right? I, like @tille, developed my script on Ubuntu and expected it to build a Windows EXE. I see how that doesn't make sense.

@tille
Copy link

tille commented Apr 13, 2015

@ashes999 well there is an option to build over linux using ruby wrappers however seems doesn't work
gosu/releasy#57

@ziggyjosh16
Copy link

ziggyjosh16 commented Feb 22, 2018

image

Running ruby 2.4.1p111 [x64mingw32] on Windows 7

also this fails:

image

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

10 participants