Ruby and activerecord-oracle_enhanced-adapter - ruby

I have a query about RadRails and the activerecord-oracle_enhanced-adapter. I am using RadRails 2.
Below is a list of my local gems, garnered from the output of the gem list –local command:
*** LOCAL GEMS ***
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activerecord-oracle_enhanced-adapter (1.6.7)
activeresource (2.3.4)
activesupport (2.3.4)
bigdecimal (1.2.6)
io-console (0.4.3)
json (1.8.1)
oracle_enhanced (1.2.5)
psych (2.0.8)
rack (1.0.1)
rails (2.3.4)
rake (10.4.2)
rdoc (4.2.0)
However, when I try to run the rake migrate command the following appears:
rake aborted!
Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (no such file to load -- active_record/connection_adapters/oracle_enhanced_adapter)
(See full trace by running task with --trace)
I have uninstalled activerecord-oracle_enhanced-adapter and reinstalled it, restarted RadRails, all to no avail.

The problem is that you using rails 2.3.4 (last updated in 2010) with the newest activerecord oracle enhanced adapter 1.6.7 that released just few weeks ago.
Try to update your rails to 4.1 (it's also requires update ruby to 2.3) or downgrade activerecord-oracle_enhanced-adapter to 1.3.2 in your Gemfile:
gem 'activerecord-oracle_enhanced-adapter', '~> 1.3', '>= 1.3.2'
Also it would be better do not use so old RadRails. Try latest ruby and rails in any modern editor or IDE!

Related

"Rake/rdoc task is obsolete" message ... and none of the fixes online here are working

I am a Rails & Ruby noob and was going through the Agile Web Development with Rails book. I did a routine rake command and got this familiar message:
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (ava
ilable in RDoc 2.4.2+) instead.
c:/rails_projects/depot/Rakefile:8:in `'
I searched Google thoroughly, tried editing my Gemfile a couple of times as suggested in other threads, updated rdoc gem, and still I get this error. I am running Rails 3.0.5, Ruby 1.9.3p392, rdoc 4.0.2. This is my bundle install:
Using rake (10.0.4)
Using abstract (1.0.0)
Using activesupport (3.0.5)
Using builder (2.1.2)
Using i18n (0.6.4)
Using activemodel (3.0.5)
Using erubis (2.6.6)
Using rack (1.2.8)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.37)
Using actionpack (3.0.5)
Using mime-types (1.22)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.2.19)
Using actionmailer (3.0.5)
Using arel (2.0.10)
Using activerecord (3.0.5)
Using activeresource (3.0.5)
Using json (1.7.7)
Using bundler (1.3.4)
Using thor (0.14.6)
Using railties (3.0.5)
Using rails (3.0.5)
Using rdoc (4.0.1)
Using sqlite3 (1.3.7)
And my Gemfile:
gem 'rails', '3.0.5'
gem 'sqlite3'
gem 'rdoc', ">= 4.0.1"
require 'rdoc/task'
I put that gem rdoc thing in based on one forum I found.
The bad require 'rake/rdoctask' call is happening in Rails itself. The simplest solution is probably to update Rails. You should be able to work through that book just fine using Rails 3.0.20.

passenger error Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter`, ruby 1.9.2 rails 2.3.8

i have a problem - i have Ubuntu 12.04 server and I am trying to host ruby on rails app on it.
I have chosen passenger with apache. I have installed RVM and made gemset "ruby-1.9.2-p320#myapp" and it works. I have really old rails 2.3.8 app, which is just for archive for me and I dont have any time to update it.
I have passenger error Please install the mysql2 adapter: 'gem install activerecord-mysql2-adapter' (no such file to load -- active_record/connection_adapters/mysql2_adapter)
My "gem list":
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activerecord-mysql2-adapter (0.0.3)
activeresource (2.3.8)
activesupport (2.3.8)
bundler (1.2.3)
daemon_controller (1.1.1)
fastthread (1.0.7)
mislav-will_paginate (2.3.11)
mysql2 (0.2.7)
passenger (3.0.19)
rack (1.1.6)
rails (2.3.8)
rake (10.0.3)
rubygems-bundler (1.1.0)
rubygems-update (1.8.25, 1.3.5)
rvm (1.11.3.6)
sqlite3 (1.3.7)
sqlite3-ruby (1.3.3)
thoughtbot-paperclip (2.3.1)
will_paginate (3.0.4)
I can using ruby script/console get to database records, so connection with database is established and it WORKS.
Is there any ideas for solution?
Thank you.
If any extra info is needed, it will be provided asap.
This was misconfiguration of Passenger and Apache from my part.
Just follow these loveley tutorial and all will be OK: http://everydayrails.com/2010/09/13/rvm-project-gemsets.html
And if you afterwards run into problems of UTF-8 errors for older rails apps, just read on that here: http://railsforum.com/viewtopic.php?id=42009

Ruby on Rails - New to Ruby help with rake db:migrate

I am a new user to Ruby on Rails and am having an issue with: rake db:migrate.
After I bundle install, the following comes up:
$ bundle install
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using bundler (1.0.18)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using sqlite3-ruby (1.2.5)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Then, when I try and rake db:migrate, i get the following:
$ rake db:migrate
Could not find polyglot-0.3.2 in any of the sources
Run `bundle install` to install missing gems.
Anyone have any advice? Thanks.
I am on ruby 1.8.7 and rails 3.0.9
Check where it's installed:
gem list -d polyglot
Run bundle exec to make sure rake uses what's specified in your gemfile:
bundle exec rake db:migrate
Ya..apparently the polyglot gem is not included in your gem file.
Also try doing gem install polyglot...
Hope it helps !
bundle exec rake db:migrate might help too..

Ruby undefined method error using Deprecate.skip_during

I am trying to install Gitorious in my local computer. However I get this error when I execute the console application:
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:194:in
block in stub_source_index170':
undefined methodskip_during' for
Bundler::RubygemsIntegration::Deprecate:Class
(NoMethodError)
The ruby code that is executing in /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb is:
def stub_source_index170(specs)
Gem::SourceIndex.send(:define_method, :initialize) do |*args|
#gems = {}
# You're looking at this thinking: Oh! This is how I make those
# rubygems deprecations go away!
#
# You'd be correct BUT using of this method in production code
# must be approved by the rubygems team itself!
#
# This is your warning. If you use this and don't have approval
# we can't protect you.
#
Deprecate.skip_during do
self.spec_dirs = *args
add_specs(*specs)
end
end
end
I guess the error occurs because the deprecate module is not loaded or something like that... I don't know ruby... but how can I try to correct it?
I have ruby 1.9.1p431 (2011-02-18 revision 30908) with gem 1.8.5
List of gems:
* LOCAL GEMS *
actionmailer (2.3.5) actionpack
(2.3.5) activerecord (2.3.8, 2.3.5)
activeresource (2.3.5) activesupport
(2.3.8, 2.3.5) acts-as-taggable-on
(2.0.6) builder (3.0.0) bundler
(1.0.15) chronic (0.3.0)
daemon_controller (0.2.6) daemons
(1.1.0) diff-lcs (1.1.2) echoe (4.3.1)
eventmachine (0.12.10)
exception_notification (1.0.20090728)
factory_girl (1.3.3) fastthread
(1.0.7) gemcutter (0.6.1) geoip
(0.8.9) hoe (2.8.0) json_pure (1.5.0)
mime-types (1.16) mocha (0.9.10) mysql
(2.8.1) oauth (0.4.4) paperclip
(2.2.9.2) passenger (3.0.7)
proxymachine (1.2.4) rack (1.0.1)
rails (2.3.5) rake (0.8.7) rdiscount
(1.3.1.1) revo-ssl_requirement (1.1.0)
riddle (1.2.2) rmagick (2.13.1)
ruby-hmac (0.4.0) ruby-openid (2.1.8)
ruby-yadis (0.3.4) rubyforge (2.0.4)
shoulda (2.9.2) state_machine (0.9.4)
stomp (1.1) stompserver (0.9.9) tuxml
(0.0.1) validates_url_format_of
(0.1.1) will_paginate (2.3.15)
Many thanks in advance.
Carlos.
Newer versions of Rubygems are deprecating some old internal methods. You can downgrade Rubygems with gem update --system 1.x.y (e.g. 1.5.2) to see if that solves your problem.
Deprecate was namespaced to Gem::Deprecate. You can temporary patch it:
Gem::Deprecate.skip_during do
self.spec_dirs = *args
add_specs(*specs)
end

Rake 0.8.7 and ActiveSupport 3.0.1

I am running Ruby 1.9.2. I have rake 0.8.7 installed. However running rake inside a Rails application gives me the following:
(in /usr/home/users/dimitar/Rails/spek)
Could not find activesupport-3.0.1 in any of the sources
Try running `bundle install`.
So I go ahead and run bundle install again and everything looks good:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.1)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.1)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.1)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.7)
Using actionmailer (3.0.1)
Using arel (1.0.1)
Using activerecord (3.0.1)
Using activeresource (3.0.1)
Using bundler (1.0.3)
Using thor (0.14.3)
Using railties (3.0.1)
Using rails (3.0.1)
Using sqlite3-ruby (1.3.1)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
But rake still gives me the same error message. Any suggestions?
Actually the problem seems to come from the config/boot.rb file:
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Do you have multiple Ruby interpreters installed (maybe via rvm or some other method)? If so, are you sure that the right one is active?
Things to look at:
which ruby
which rake
ruby -e 'puts $:' # To show the LOAD_PATH for gems
I had a similar problem using ruby-1.9.2 and fixed it by upgrading rubygems
sudo gem update --system
I had the same problem when I was using REE 1.8.7. I switched to 1.9.2 and did bundle install. Then my rake commands worked.
I had this issue when I mistakenly ran passenger with ruby 1.9.3 and the app used 1.8.7 in its .rvmrc. Fixed by using 1.9.3 (now I have encoding problems, but thats a different story).

Resources