How to use Rails 3 beta with oracle_enhanced 1.3.0 beta

79 views
Skip to first unread message

Raimonds Simanovskis

unread,
Mar 9, 2010, 5:14:23 PM3/9/10
to Oracle enhanced adapter for ActiveRecord
OK, as there are so many interested people who would like to test
Rails 3 on Oracle I published everything that is needed and here are
simple instructions.

I created simple Rails 3 on Oracle application where you can find
necessary files that you need: http://github.com/rsim/rails3_oracle_sample

At first I assume that you will read about how to create new Rails 3
application or upgrade your existing one to Rails 3. You can start
e.g. with http://www.rubyinside.com/rails-3-0-beta-links-2966.html to
find out all necessary links.

In addition to get Rails 3 working with Oracle you need to copy or
modify some additional files to your project.

This is sample app contains several important files necessary for
using Rails 3 on Oracle database using oracle
database.

Gemfile
http://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile
Specifies that latest version of oracle_enhanced adapter gem and Arel
gem should be used from github.

config/initializers/oracle.rb
http://github.com/rsim/rails3_oracle_sample/blob/master/config/initializers/oracle.rb
The main thing is that it requires lib/rails3_oracle_patches.rb (see
below).
All other options are the same as previously.

lib/rails3_oracle_patches.rb
http://github.com/rsim/rails3_oracle_sample/blob/master/lib/rails3_oracle_patches.rb
Contains several patches for Rails 3 beta that are necessary for
oracle_enhanced adapter.

When you will copy these files to your application then the main thing
is that you need to run "bundle install" and it will install in your
~/.bundle directory latest versions of oracle_enhanced and arel gems
from github.

After that you should be able to start to use your Rails 3 application
on Oracle :)

If you experience any issues then at first please try to verify that
it is particular Rails 3 and oracle_enhanced adapter issue. But in
these cases please discuss these issues here or even better try to
fork rails3 branch of oracle_enhanced adapter and try to create
failing test and patch :)

Raimonds


bithive

unread,
Mar 10, 2010, 7:40:47 PM3/10/10
to Oracle enhanced adapter for ActiveRecord
Thanks for the this post, it was very helpful.

I had to use:

git "git://github.com/brynary/arel.git"

instead of:

gem "arel", ">=0.2.1", :git => 'git://github.com/brynary/arel.git'

in order to get "bundle install" to not do this:

rails3:~/app$ bundle install
Updating git://github.com/rsim/oracle-enhanced.git
Updating git://github.com/brynary/arel.git
Fetching source index from http://gemcutter.org/
Resolving dependencies
Updating git://github.com/brynary/arel.git
Updating git://github.com/rsim/oracle-enhanced.git
No compatible versions could be found for required dependencies:
arel (~> 0.2.0, runtime) not found in any of the sources
required by rails (= 3.0.0.beta, runtime)
All possible versions of origin requirements conflict.

Raimonds Simanovskis

unread,
Mar 11, 2010, 9:10:34 AM3/11/10
to Oracle enhanced adapter for ActiveRecord
The issue is that Arel gem on github was just updated to version 0.3.1
and it didn't satisfy activerecord-3.0.0.beta dependency on arel
~>0.2.0 and therefore you got this error.

Please update Gemfile with the following line (see also
http://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile)

gem "arel", ">=0.2.1", :git => 'git://github.com/rsim/
arel.git', :branch => 'oracle'

In my oracle branch I fixed the point where version is still 0.2.1 but
it has all the necessary changes.
If you did as you described then you didn't get the latest version of
Arel gem but the version that is published on gemcutter.

Hopefully with next version of Rails 3 beta there will be less gem
dependency issues :)

Raimonds

On Mar 11, 2:40 am, bithive <jason.mein...@gmail.com> wrote:
> Thanks for the this post, it was very helpful.
>
> I had to use:
>
> git "git://github.com/brynary/arel.git"
>
> instead of:
>
> gem "arel", ">=0.2.1", :git => 'git://github.com/brynary/arel.git'
>
> in order to get "bundle install" to not do this:
>
> rails3:~/app$ bundle install
> Updating git://github.com/rsim/oracle-enhanced.git
> Updating git://github.com/brynary/arel.git

> Fetching source index fromhttp://gemcutter.org/

Raimonds Simanovskis

unread,
Mar 16, 2010, 1:32:01 PM3/16/10
to Oracle enhanced adapter for ActiveRecord
If you use oracle_enhanced 1.3.0 beta with Rails 3.0 beta then it is
highly recommended to turn on column caching as currently Arel does a
lot of additional queries on table columns and primary keys. I was
discussing with Arel team that it would be good to do table metadata
caching in Arel as well but until that you can cache this information
in oracle_enhanced side, see
http://github.com/rsim/rails3_oracle_sample/blob/master/config/initializers/oracle.rb#L27-34

Raimonds

On Mar 11, 4:10 pm, Raimonds Simanovskis


<raimonds.simanovs...@gmail.com> wrote:
> The issue is that Arel gem on github was just updated to version 0.3.1
> and it didn't satisfy activerecord-3.0.0.beta dependency on arel
> ~>0.2.0 and therefore you got this error.
>

> Please update Gemfile with the following line (see alsohttp://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile)

Udi

unread,
Mar 21, 2010, 3:46:31 AM3/21/10
to Oracle enhanced adapter for ActiveRecord
Raimonds,

Thanks for this useful instruction,
unfortunately when I type

bundle pack

shows the following error
Could not find gem 'activerecord-oracle_enhanced-adapter (>=
1.3.0.beta2, runtime)' in git://github.com/rsim/oracle-enhanced.git
(at master).
Source does not contain any versions of 'activerecord-oracle_enhanced-
adapter (>= 1.3.0.beta2, runtime)'

Please give me enlightenment please

Regards

Udi

Raimonds Simanovskis

unread,
Mar 21, 2010, 5:59:30 PM3/21/10
to Oracle enhanced adapter for ActiveRecord
I have a problem that bundler caches gems from github and is not
retrieving the latest version. So if you have installed
oracle_enhanced version 1.3.0.beta1 from github then it is caching it
and not retrieving latest version 1.3.0.beta2.
Now I am solving it by removing bundler git cache directory:
rm -rf .bundle/ruby/1.8/cache/bundler

And also it should be enough to use "bundle install" (which installs
necessary gems in ~/.bundle directory), it is not mandatory to do also
"bundle pack" (which copies all gems to Rails app vendor/cache
directory)

Raimonds

Raimonds Simanovskis

unread,
Mar 22, 2010, 1:51:55 AM3/22/10
to Oracle enhanced adapter for ActiveRecord
Correction - removing of bundler git cache should be done with
rm -rf ~/.bundle/ruby/1.8/cache/bundler

Raimonds

On Mar 21, 11:59 pm, Raimonds Simanovskis

Udi

unread,
Mar 24, 2010, 1:36:12 PM3/24/10
to Oracle enhanced adapter for ActiveRecord
Raimonds,

I have a fresh install of Rails 3 beta on my Windows 7.

This is my gem list

abstract (1.0.0)
actionmailer (3.0.0.beta)
actionpack (3.0.0.beta)
activemodel (3.0.0.beta)
activerecord (3.0.0.beta)
activeresource (3.0.0.beta)
activesupport (3.0.0.beta, 2.3.5)
arel (0.2.1)
builder (2.1.2)
bundler (0.9.13)
erubis (2.6.5)
git (1.2.5)
i18n (0.3.6)
mail (2.1.3)
memcache-client (1.8.1, 1.7.8)
mime-types (1.16)
rack (1.1.0)
rack-mount (0.6.1, 0.4.7)
rack-test (0.5.3)
rails (3.0.0.beta)
railties (3.0.0.beta)
rake (0.8.7)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.4)
tzinfo (0.3.17)

I download your sample, but when I type bundle install, the following
error occured

Fetching git://github.com/rsim/oracle-enhanced.git
C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/source.rb:
288:in ``':
No such file or directory - git clone "git://github.com/rsim/oracle-
enhanced.git
" "C:/Users/Papa/.bundle/ruby/1.8/cache/bundler/git/oracle-
enhanced-35f26176bf0c
8e76ceaff468030e8aebad7d65bf" --bare --no-hardlinks (Errno::ENOENT)
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
source.rb:288:in `git'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
source.rb:322:in `cache'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
source.rb:256:in `specs'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:83:in `remote_index'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:81:in `each'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:81:in `remote_index'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
index.rb:5:in `build'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:78:in `remote_index'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:70:in `resolve_remotely'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
environment.rb:28:in `specs'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:21:in `run'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
installer.rb:6:in `install'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
cli.rb:71:in `install'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/task.rb:33:in `send'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/task.rb:33:in `run'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/invocation.rb:109
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/invocation.rb:116:in `call'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/invocation.rb:116:in `invoke'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor.rb:137:in `start'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor/base.rb:378:in `start'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/lib/bundler/
vendor/thor.rb:124:in `start'
from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-0.9.13/bin/bundle:
11
from C:/Ruby/bin/bundle:19:in `load'
from C:/Ruby/bin/bundle:19

Do you have suggestions?


Regards


Udi

Raimonds Simanovskis

unread,
Mar 24, 2010, 5:41:37 PM3/24/10
to Oracle enhanced adapter for ActiveRecord
Do you have git installed? Based on the error message I assume that
bundler cannot find git command.
Here is info how to get git on Windows -
http://github.com/guides/using-git-and-github-for-the-windows-for-newbies

Raimonds

Raimonds Simanovskis

unread,
Apr 5, 2010, 5:39:05 PM4/5/10
to Oracle enhanced adapter for ActiveRecord
I have verified that oracle_enhanced 1.3.0 beta works quite OK with
just released Rails 3.0.0.beta2

I have updated my sample application's Gemfile for Rails 3.0.0.beta2
http://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile

If you already tried initial Rails 3.0.0.beta then also run "rake
rails:update:configs" to update Rails configuration files with latest
Rails API changes (but review all updates and restore your changes as
needed).

Raimonds

On Mar 25, 12:41 am, Raimonds Simanovskis


<raimonds.simanovs...@gmail.com> wrote:
> Do you have git installed? Based on the error message I assume that
> bundler cannot find git command.

> Here is info how to get git on Windows -http://github.com/guides/using-git-and-github-for-the-windows-for-new...

Reply all
Reply to author
Forward
0 new messages