+ Start a Discussion
Jim ZhanJim Zhan 

ActiveSalesforce doesn't work

Ruby 1.8.5-p12
Rails 1.2.2
ActiveSalesforce 1.1.0

# environment.rb
Rails::Initializer.run do |config|   
    # Add Salesforce support into ActiveRecord
    require_gem 'activesalesforce' 
end

# database.yaml
adapter: activesalesforce
url: https://test.salesforce.com
username: <username>
password: <password>


Then I got these errors:

Code:
=> Booting WEBrick...
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant ActiveRecord::ConnectionAdapters::Column (NameError)
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:452:in `const_missing'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/column_definition.rb:32
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/asf_adapter.rb:25
         ... 30 levels...
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from server:3


 

Jim ZhanJim Zhan
by replacing
Code:
# environment.rb
Rails::Initializer.run do |config|   
    # Add Salesforce support into ActiveRecord
    require_gem 'activesalesforce' 
end

with
Code:
# environment.rb
Rails::Initializer.run do |config|   
end
# Add Salesforce support into ActiveRecord
require_gem 'activesalesforce' 
then I got these:
Code:
database configuration specifies nonexistent activesalesforce adapter
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:210:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:202:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:229:in `initialize_database'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `run'
D:/komodo-workshop/cw/script/../config/../config/environment.rb:13
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/webrick.rb:52
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
D:/komodo-workshop/cw/script/server:3
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:210:in `establish_connection': database configuration specifies nonexistent activesalesforce adapter (ActiveRecord::AdapterNotFound)
 from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:202:in `establish_connection'
 from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:229:in `initialize_database'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in `process'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `send'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `run'
 from D:/komodo-workshop/cw/script/../config/../config/environment.rb:13
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  ... 10 levels...
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'

 seems that Rails didn't get the activesalesforce adatper.

Doug ChasmanDoug Chasman
I am not sure why you decided to even try moving the
require_gem 'activesalesforce' 

outside of the initializer run block - that code will no longer be executed hence the "missing" adapter error.

We have not yet certified ASF with rails 1.2.2 (looking at that now).
Doug ChasmanDoug Chasman
I just verified that ASF is working properly with rails 1.2.2
Jim ZhanJim Zhan
Tks for your reply, Doug. Could you share me your config? :smileywink:
Doug ChasmanDoug Chasman
The problem is not ASF or Rails - its an issue with the latest version of gem and I am able to repro this locally now after upgrading to gem 0.9.2

Working on a fix now.
Doug ChasmanDoug Chasman
I am finding a bunch of articles on this and they all point to issues with the latest version of gem (it does not appear to be healthy at all):

http://weblog.rubyonrails.org/2007/2/6/in-case-you-re-having-trouble-installing-gems

Did you happen to use the gem method instead of require_gem in your config files/source code in an attempt to  remove the depre4cation warnings?
Jim ZhanJim Zhan
yes, I did try using gem instead of require_gem, but no luck either. with require_gem, I got these
Code:
=> Booting WEBrick...
D:0:Warning: require_gem is obsolete.  Use gem instead.
c:0:Warning: require_gem is obsolete.  Use gem instead.
c:0:Warning: require_gem is obsolete.  Use gem instead.
c:0:Warning: require_gem is obsolete.  Use gem instead.
uninitialized constant ActiveRecord::ConnectionAdapters::Column
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:263:in `load_missing_constant'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:452:in `const_missing'
c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/column_definition.rb:32
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/asf_adapter.rb:25
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/activesalesforce.rb:18
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:279:in `activate'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:278:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:278:in `activate'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:76:in `active_gem_with_options'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:61:in `require_gem'
D:/komodo-workshop/cw/script/../config/../config/environment.rb:45
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:41:in `run'
D:/komodo-workshop/cw/script/../config/../config/environment.rb:13
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/webrick.rb:52
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
D:/komodo-workshop/cw/script/server:3
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant ActiveRecord::ConnectionAdapters::Column (NameError)
 from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:452:in `const_missing'
 from c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/column_definition.rb:32
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
 from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
 from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
 from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
 from c:/ruby/lib/ruby/gems/1.8/gems/activesalesforce-1.1.0/lib/asf_adapter.rb:25
  ... 30 levels...
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
 from D:/komodo-workshop/sf/script/server:3

 with gem, I got these:
Code:
=> Booting WEBrick...
database configuration specifies nonexistent activesalesforce adapter
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:210:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:202:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:229:in `initialize_database'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `run'
D:/komodo-workshop/cw/script/../config/../config/environment.rb:13
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/webrick.rb:52
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
D:/komodo-workshop/cw/script/server:3
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:210:in `establish_connection': database configuration specifies nonexistent activesalesforce adapter (ActiveRecord::AdapterNotFound)
 from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:202:in `establish_connection'
 from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:195:in `establish_connection'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:229:in `initialize_database'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in `process'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `send'
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `run'
 from D:/komodo-workshop/cw/script/../config/../config/environment.rb:13
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
  ... 10 levels...
 from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
 from D:/komodo-workshop/sf/script/server:3

 

Lee HIndeLee HInde
Hi;

Has this been resolved? We're having the same issue now.

Thanks.
Jim ZhanJim Zhan
no luck yet :smileysad:
Doug ChasmanDoug Chasman
activesalesforce1.1.3.gem (released this morning) now supports the latest version of rubygems and rails