function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arjunghosharjunghosh 

Activesalesforce gem not working for me.

Hi,
I have problem here and have searched a lot on net but did not get any answers.

Now what i am trying to do is create a rails app which talks to SalesForec API.
I did a search found a Rails gem called 'activesalesforce'. version is  the latest  1.1.6
Now i installed it as per the instructions at http://activesfdc.rubyforge.org/. And it got installed properly with dependencies. Even check it in the gem list.
Now when i try try run my server(using webrick for dev), it gives me error:-
F:\salesforcetestapp>ruby script/server
=> Booting WEBrick…
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_a
dapters/abstract/connection_specification.rb:231:in `establish_connection': Please install the activesalesforce adapter: `gem install activerecord-activesalesforce-adapter` (no such file to load—active_record/connection_adapters/activesalesforce_adapter) (RuntimeError)

I am updated my rails and other gems.
Now i have :-
Rails - 2.0.2
Ruby is 1.8.5
MySql is 5.0.27
WebRick is 1.3.1
Gem is 0.9.4 (gem -v)

I have checked the gem versions and also checked if
'activesalesforce' is installed by gem list command.
 I also went ahead and installed the version 1.1.4 also.
My env/config file has :-
Rails::Initializer.run do |config|
.....
....
     require  'activesalesforce'
end


I even changed the above and included :-
Rails::Initializer.run do |config|
.....
....
  gem 'activesalesforce'
     require  'activesalesforce'
end


Still i get above error.
My database YML was before in the format:-
development:
  adapter: activesalesforce
  url: https://www.salesforce.com
  username: <my dev login>
  password: <my dev password>

But when i changed the YML to:-
development:
....
....
test:
.....
.....
production:
.....
.....
saleforec:
  adapter: activesalesforce
  url: https://www.salesforce.com
  username: <my dev login>
  password: <my dev password>

Then I don't get any error but THEN i dont know if the gem is initialized or not in my rails app when it is started.

The folllowing is not as important query to get solved as the above issue faced by me.
Also another issue with this salesforce integration is that i am not getting resource or blog online which speaks about rails implementation of saleforce integration.
I have questions like "How do we access local db when salesforce gem makes the db configuration in a way that seems that rails app can access only salesfore dataset?"
or "How to acces my local db as well as the salesfore data objects"?
Generally pointers to how do i go about doing the integration.

So if anyone can throw any light, it would be much appreciated.
Thanks in advance
ciao
Arjun
dchasmandchasman
Rails 2.x is not currently support by ASF - have not even tried it with that environment yet and a few folks that have are also reporting issues. The rails folks tend to make changes in the adapter layer without much regard for backward compatibility (has cuased issues for ASF 2 times in the past) - this layer in Rails is pretty lose as far as a supported API is concerned. I do not have an ETA for this support just yet (on vacation this week and next week - I'll try to get a look at it after that) - have been actively looking for folks to join the ASF team as contributors and after over a year only one person has stepped up to offer to give something back to ASF but that was for documentation not development.

As for multiple connections that has been supported for quite some time but you need to add code to explicitly manage which active records are backed by which connection.


Message Edited by dchasman on 12-28-2007 09:59 AM
dchasmandchasman
The good news: Rails has finally formalized and externalized 3rd party connection adapter development and registration and not much else in this layer has changed.

The bad news: totally horks existing "hacked" registration approaches we've all been using to date.

I should be able to get things working with Rails 2.0 in the next week or so.
dchasmandchasman
The next release of ASF will have the modifications to support the changes in connection adapter registration and a couple of sfdc api changes required by changes in Rails 2.x.

I am currently testing ASF 2.0.0 now and expect to release it in the next day or so.
arjunghosharjunghosh
Hi Doug,
 thanks for the prompt reply. Also for quickly looking into this issue with Rails 2.x. I owe you a beer if ever come down to New Delhi, India. :).
Also for the second part of my question relating to multiple connection where i can point to my local db as well as access salesforece data objects - if you can point me to any link or blog by someone who might have done this for Rails and SF, it would be very helpfull.
You can also reply at arjun.ghosh@bluewhalelabs.com
Thanks and Happy new year.
ciao
Arjun