Re: [jruby-user] Re: JRuby: gem install paths not working compared to Ruby

Rodrigo Botafogo <[email protected]> Tue, 6 Jan 2015 10:47:36 -0200
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CAAKc=GA2_a5VpsYDnhPWDW6ZBPaGbJhMYa0k7WD51AyGJogxwA@mail.gmail.com>
Hi,

I use JRuby in Cygwin without problem. I can get gem installed also. I did
not use rvm or any other manager. I haven´t installed Rails. If you want, I
might try to find my configurations for cygwin and Ruby. Some things I´ve
done:

   - Download jruby.tar from JRuby site
   - untar jruby and copy the directory to my cygwin directory
   - make a symbolic link (ln -s) from ‘jruby’ to ‘jruby-1.7.18/‘ (this
   will make it easier to upgrade later)
   - Download java jdk (from Oracle) and put it on my cygwin directory
   - add symbolic link from ‘jdk-7’ to above directory

In bash_profile

# Add access to java and and jruby before any other path
PATH=/jre7:/jdk-7:/jdk-7/bin:$PATH
PATH=~/bin:/jruby/bin:$PATH

I think this was all. After that, for developing my gems I have created a
config file to fix cygwin path. Does this help you in any way?

If you need my config.rb file let me know.

Hope this will be of any use!

Cheers…
​

2015-01-06 3:50 GMT-02:00 Christian MICHON <[email protected]>:

> When using jruby, expand path will return paths using java. In your it is
> a standard windows java instalation. You cannot expect a Cygwin path out of
> it...
>
> You need to use a Java setup compatible with Cygwin first.  I do not know
> if this exists.
> On Jan 6, 2015 12:40 AM, "Johan Wasserman" <[email protected]> wrote:
>
>> Christian,
>>
>> rvm use jruby
>> Using /Johan_Wasserman.rvm/gems/jruby-1.7.18
>>
>> jruby -S jgem install bundler
>> ERROR:  While executing gem ... (Errno::ENOENT)
>>     No such file or directory -
>> C:\Johan_Wasserman.rvm\gems\jruby-1.7.18\gems\bundler-1.7.11
>>
>>
>> After finding a couple of issues reported on Jira and Github I suspect a
>> bug in JRuby.
>>
>> These tests confirm the suspicion:
>> jruby -S irb
>> irb(main):001:0> File.exists?('/Johan_Wasserman.rvm/test.txt')
>> => true
>> irb(main):002:0> File.expand_path('/Johan_Wasserman.rvm/test.txt')
>> => "C:/Johan_Wasserman.rvm/test.txt"
>> irb(main):003:0> File.absolute_path('/Johan_Wasserman.rvm/test.txt')
>> => "C:/Johan_Wasserman.rvm/test.txt"
>> irb(main):004:0> File.dirname('/Johan_Wasserman.rvm/test.txt')
>> => "/Johan_Wasserman.rvm"
>>
>>
>> My home path ion Cygwin is /Johan_Wasserman.rvm, translating to the
>> Windows canonical path
>> C:\Zones\Programs\xnix\cygwin64\Johan_Wasserman.rvm
>>
>> expand_path and absolute_path both returned the windows path
>> C:\Johan_Wasserman.rvm, which of course is incorrect, and therefore the
>> gem installer cannot find the files it just downloaded.  I'm updating
>> issue #2387 on Github with my findings.
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>


-- 
Rodrigo Botafogo