1 2 3 4 5 Previous Next 60 Replies Latest reply on Sep 17, 2011 4:02 AM by 888792 Go to original post
      • 45. Re: My Fix
        878841
        How will JRuby help?

        Don't you still end up with a 64-bit Ruby failing because of the useless 64-bit InstantClient?
        • 46. Re: My Fix
          burleigh
          Randy wrote:
          How will JRuby help?

          Don't you still end up with a 64-bit Ruby failing because of the useless 64-bit InstantClient?
          I haven't yet seen the full stack at work, so can't say for sure that this alternative route will succeed. And obviously this route is pitched to the Ruby and (optionally) the Rails people in the room. But:

          * I have RVM

          * I ask RVM to show me installed rubies:
          rvm rubies
          => jruby-1.6.3 [ darwin-x86_64-java ]

          * I have Rails 3.x gems:
          rails -v
          Rails 3.0.9

          * I have the Oracle Enhanced Adapter and the JDBC adapter:
          activerecord-jdbc-adapter (1.1.3)
          activerecord-oracle_enhanced-adapter (1.3.2)

          * I have Oracle's "thin" JDBC driver:
          - emulates SQL*Net -- or at least don't depend on lower-level libraries to provide it
          - I copied ojdbc6.jar from SQL Developer's install to my jruby/lib.

          * The Oracle Enhanced Adapter claims to support JDBC connections through JNDI (I'm just repeating here).

          * This paper helped me quickly get a Ruby test harness (no need for all the Rails wait just to see if this path has merit):
          http://www.oracle.com/technetwork/articles/dsl/jruby-oracle11g-330825.html
          - It includes jdbc_connection.rb
          - and here's my variant of the paper's test_oracle.rb:

          # test_connect.rb
          require 'jdbc_connection'

          # Edit these for your database schema
          user = ""
          passwd = ""
          url = "jdbc:oracle:thin:@host/sid_or_servicename"

          print "Run at #{Time.now} using JRuby #{RUBY_VERSION}\n\n"

          begin
          conn = OracleConnection.create(user, passwd, url)
          # Display connection using the to_s method of OracleConnection
          puts conn, "\n"

          rescue
          puts "\n** Error occurred **\n"
          puts "Failed executing Oracle demo from JRuby ", $!, "\n"

          ensure

          conn.close_connection
          end

          print "\nEnded at #{Time.now}\n"

          * Now test from the command line with:
          ruby test_connect.rb

          * It worked -- no Instant Client needed.

          Edited by: burleigh on Aug 2, 2011 10:21 AM
          • 47. Re: Instant client segfaults in OS X 10.7
            880035
            This is no longer just a developer preview problem. Lion was released and is still having problems with the oracle instant client. Please fix this as my business depends on it.
            • 48. Re: My Fix
              683351
              On OSX Lion here is what I did to get a working 32-bit Instant Client and 32 bit Ruby working. I am not using rails...

              Install XCode

              Download Unzip instant client to a directory.

              Install rvm if you haven't already done so.

              Add the following to your bash profile (change directories to match where you put client)

              export DYLD_LIBRARY_PATH="/Users/jasoncotter/instantclient_10_2/"
              export TNS_ADMIN="/Users/jasoncotter/instantclient_10_2/admin/"
              export SQLPATH="/Users/jasoncotter/instantclient_10_2/"
              export ORACLE_HOME="/Users/jasoncotter/instantclient_10_2/"
              export NLS_LANG="AMERICAN_AMERICA.UTF8"
              export PATH="$PATH:/usr/local/bin/"
              export PATH="$PATH:/Users/jasoncotter/instantclient_10_2/"

              Run on command line:

              rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.9.2 --patch osx-arch-fix

              rvm use 1.9.2

              gem install ruby-oci8

              Edited by: jcotter on Aug 3, 2011 3:40 PM
              • 49. Re: My Fix
                880035
                This worked for me installing ruby-1.8.7-p302 as well. Thanks jcotter.
                • 50. Re: My Fix
                  burleigh
                  jcotter wrote:
                  On OSX Lion here is what I did to get a working 32-bit Instant Client and 32 bit Ruby working. I am not using rails...
                  [snip]
                  Run on command line:

                  rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.9.2 --patch osx-arch-fix
                  The last bit must be magical:

                  --patch osx-arch-fix

                  to fix the linker problems. My effort to install the 32 bit client this weekend, which did not include that bit, always failed with linker problems on the ruby standard library (I think). For the moment, because I only need the client for Ruby / Rails work, I'm going to stay with the JRuby and JDBC approach.

                  Meanwhile, my Oracle SR has completed its path, and is closed with no immediate resolution. The process did yield information that Oracle's in the planning stage for a new client to support 10.7 "Lion." No details, time-frame, or estimates were given, and I did not complain that this fault had been spotted many months ago by developers.
                  rvm use 1.9.2

                  gem install ruby-oci8

                  Edited by: jcotter on Aug 3, 2011 3:40 PM
                  • 51. Re: My Fix
                    881070
                    Note that you can have all the goodness of MRI and the BS of the i386 version of the same MRI at the same time

                    rvm cleanup all

                    rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.9.2 --patch osx-arch-fix -n i386

                    the -n allow for custom naming of rubies under rvm

                    rvm alias create i386 ruby-1.9.2-p290-i386

                    that allows you to do something rvm use i386@oracle in the CLI or .rvmrc

                    Kill the shell cause it's in a bad place with all the -arch flags and the such

                    $ rvm list rubies

                    rvm rubies

                    macruby-0.10 [ x86_64 ]
                    ruby-1.8.7-p352 [ x86_64 ]
                    ruby-1.9.2-p290 [ x86_64 ]
                    ruby-1.9.2-p290-i386 [ i386 ]
                    • 52. Re: My Fix
                      879385
                      Great thanks. At the moment with your help I can continue using Lion with Ruby with ruby-oci8 while waiting for update of Instant Client x86_64 version.
                      • 53. Re: My Fix
                        881856
                        I followed the steps from jcotter's post, but now, when I try to install any gem, I get this error:
                        $ gem install bundler
                        Fetching: bundler-1.0.17.gem (100%)
                        dyld: lazy symbol binding failed: Symbol not found: _syckparse
                        Referenced from: /Users/martin/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i386-darwin11.0.0/syck.bundle
                        Expected in: flat namespace

                        dyld: Symbol not found: _syckparse
                        Referenced from: /Users/martin/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i386-darwin11.0.0/syck.bundle
                        Expected in: flat namespace

                        Trace/BPT trap: 5
                        I have been unable to find any solution by experimenting, Google or IRC. Anyone here got a solution?

                        --(Apart from Oracle fixing the 64bit client, although it doesn't seem like it will happen any time soon...)--

                        John Brien's parameters worked (sans CC=...)..

                        Edited by: Martin Troels Eberhardt on Aug 12, 2011 10:17 AM
                        • 54. Re: My Fix
                          881940
                          @John Brien, we don't need to force gcc-4.2 compiler when installing? As in:

                          CC=/usr/bin/gcc-4.2 rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install *1.8.7* --patch osx-arch-fix -n i386

                          Should the x_archflags all work for 1.8.7 as well?

                          Edited by: user5418844 on Aug 11, 2011 12:28 PM
                          • 55. Re: My Fix
                            881940
                            I tried my CLI line from my last post and it failed with or without the gcc-4.2 addition. Does anyone know the command to install 32-bit 1.8.7 via rvm?

                            Just to make sure it was a 1.8.7 issue, I ran John Brien's line verbatim and it compiled/installed 1.9.2 i386 without errors (Lion was booted in 32-bit mode for all my installations).... however, even though "rvm list" shows *ruby-1.9.2-p290-i386 [ i386 ]*, when using that ruby version, "ruby -v" shows: *ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]* ??

                            Do I have the 32-bit or 64-bit version installed?

                            If I've done all my dev work with Rails 2.3.2 via Ruby 1.8.7, would it be preferable to switch over to 1.9.2 at this time? eg.Can 1.9.2 be swapped in and still work with a Rails 2.3.2 app? I've held off upgrading anything because systems won't upgrade production, but I am now forced to jump through versioning hoops of death just to get a dev environment functioning in Lion!
                            • 56. Re: Instant client segfaults in OS X 10.7
                              579233
                              Recenty after installing php5-oracle on my macosx lion i've received "Segmentation Fault (11)" error when tried to run anything via php.
                              My solution to this problem is: Simply download newest instantclient files (basic & sdk) 64bit versions and replace /opt/local/lib/oracle with downloaded content. Then run sudo port install php5-oracle and guest what... oci8 works perfectly fine on MacOSX Lion :)

                              Hope this helps.

                              Regards,
                              • 57. Re: Instant client segfaults in OS X 10.7
                                884786
                                Hello,

                                I've tried the same thing but I still get the error "Segmentation Fault". Could you please provide more details how did you manage to configure oci?

                                Best Regards,
                                • 58. Re: Instant client segfaults in OS X 10.7
                                  burleigh
                                  paul_s wrote:
                                  Recenty after installing php5-oracle on my macosx lion i've received "Segmentation Fault (11)" error when tried to run anything via php.
                                  My solution to this problem is: Simply download newest instantclient files (basic & sdk) 64bit versions and replace /opt/local/lib/oracle with downloaded content. Then run sudo port install php5-oracle and guest what... oci8 works perfectly fine on MacOSX Lion :)

                                  Hope this helps.

                                  Regards,
                                  Could you tell us the file dates on the library files? If they're not newer, it's hard to understand how this works for you. The other changed factor since Lion is the 10.7.1 update of a couple weeks ago. For me, using the 64 bit instant client installed quite some time ago, there was no change: "segmentation fault 11."
                                  • 59. Re: Instant client segfaults in OS X 10.7
                                    burleigh
                                    paul_s wrote:
                                    Recenty after installing php5-oracle on my macosx lion i've received "Segmentation Fault (11)" error when tried to run anything via php.
                                    My solution to this problem is: Simply download newest instantclient files (basic & sdk) 64bit versions and replace /opt/local/lib/oracle with downloaded content. Then run sudo port install php5-oracle and guest what... oci8 works perfectly fine on MacOSX Lion :)

                                    Hope this helps.

                                    Regards,
                                    Could you tell us the file dates on the library files? If they're not newer, it's hard to understand how this works for you. The other changed factor since Lion is the 10.7.1 update of a couple weeks ago. For me, using the 64 bit instant client installed quite some time ago, there was no change: "segmentation fault 11."