s3sync automate amazon backup - backup

I am really new to shell script etc.
i am trying to get s3sync to work i have installed ruby with the rubyinstaller i am on windows and have been using the cmd prompt that you get after installing ruby.
Can someone help me with these error??
C:\Sites\s3sync>s3cmd.rb listbuckets
C:/Sites/s3sync/HTTPStreaming.rb:53:in `<module:S3sync>': uninitialized constant
S3sync::SimpleDelegator (NameError)
from C:/Sites/s3sync/HTTPStreaming.rb:52:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Sites/s3sync/s3try.rb:28:in `<module:S3sync>'
from C:/Sites/s3sync/s3try.rb:10:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Sites/s3sync/s3cmd.rb:16:in `<module:S3sync>'
from C:/Sites/s3sync/s3cmd.rb:11:in `<main>'
I have been following this article but now i am stuck
http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/
Any help please

While I have not done a S3sync setup in windows, I have successfully written a CentOS / Plesk setup.
This error looks very familliar, and it looks like your config files are not set up properly. I'd check the file you store the AWS credentials in, and then also check the config file carefully. Make sure there are no leading slashes ('/') and trailing slashes only if required. Spaces... anything can set this script off with an error.
Good luck, let me know how you go.

Related

`inflate': buffer error (Zlib::BufError) on doing `bundle install`

I am trying to do a bundle install, but I'm getting the following error:
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/nish/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/util.rb:40:in `inflate': buffer error (Zlib::BufError)
from /home/nish/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/util.rb:40:in `inflate'
from /home/nish/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:536:in `inflate'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:93:in `fetch_spec'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/remote_specification.rb:46:in `_remote_specification'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/remote_specification.rb:51:in `method_missing'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:95:in `block (2 levels) in unmet_dependency_names'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:94:in `map'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:94:in `block in unmet_dependency_names'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:93:in `map'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:93:in `unmet_dependency_names'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:240:in `remote_specs'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/bin/bundle:23:in `load'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#global/bin/bundle:23:in `<main>'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#voylla/bin/ruby_noexec_wrapper:14:in `eval'
from /home/nish/.rvm/gems/ruby-1.9.2-p320#voylla/bin/ruby_noexec_wrapper:14:in `<main>'
I tried the following:
gem update --sysytem
But still I'm getting the same error. Please can someone help!. Thanks
SOLUTION
Found out what is causing the problem. In the case we are are using geminabox and the for what ever reason the railties-4.1.6.gemspec.rz was corrupted. Don't know how it happened but it was. So what we did was removed the railties-4.1.6
rm shared/gems/proxy/quick/Marshal.4.8/railties-4.1.6.gemspec.rz
after that the system bundled like normal. If you are having the same problem you are going to have to find a way to watch the network calls and see which one of the GET events it is stopping on.
EXTRA READING does not fix bug only suppresses it in some cases
The reason this worked was because the new version used a different version of railties by happen chance. It only gave the impression that this fixed the problem.
Here is some extra info on this bug. But it doesn't total explain why this is happening.
cannot install ruby gems - zlib error
Now they have removed or fixed this code in the v2.0.0-p451 but the ruby-2.1.0 has yet to merge the patches I have yet to go back threw all the code and check each and every version but here is how you can check.
What you are looking for is this file. lib/rubygems/util.rb in there is a method called inflate this method is responsible for unzipping the gem file. However there is some sort of bug with it where it is being called on things that can't be unzipped.
This is a stable version and you wont find lib/rubygems/util.rb v2.0.0-p481. So this is difficult to find but by looking at the source code you can figure out which ones have this bug and which ones don't.
If you are using rvm use this commands to install the correct version
rvm install ruby-2.0.0-p481
To see all know ruby version avaliable you can run this command below.
$ rvm list known
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p547]
[ruby-]2.0.0-p451
[ruby-]2.0.0[-p481]
[ruby-]2.1.1
[ruby-]2.1[.2]
[ruby-]2.1-head
ruby-head
...
By changing to that patch version you will should be ok. I have also found this bug using ruby-2.0.0-p247 as well.
The above code would suggest that you have the bug as well. However it is strange because the github repo says that it was not introduced until Nov 18, 2013.
https://github.com/ruby/ruby/commit/a7fa4d5d9aab150ad4b0c3f3217fe444df69f527.
Anyway I know there is a lot of information here but this bug is tricky. It seams to only effect some version of ruby but because of organization of the code it is hard to tell some times if it is in your version. Best way is to just check to see if you have the util.rb file and if you do then change versions.

How do I configure Rails and SQLPlus on Oracle VM to work together [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
For one of my projects I need to use an Oracle database on a Rails app.
For my local development, I've installed Oracle VM VirtualBox with the package Oracle Developer Day .
I successfully deployed, launched the VM, logged in and even created a user on SQLPlus with admin rights.
On my mac OSX Mavericks, I've installed instant client from Oracle as well as the following version of ruby-oci8 and activerecord-oracle_enhanced-adapter
gem ruby-oci8', '~> 2.0.6'
gem 'activerecord-oracle_enhanced-adapter', '~> 1.4.1'
My config file for my dev database is the following database.yml
development:
adapter: oracle_enhanced
host: 192.168.2.170:1521/myprogram_development
username: my_new_sql_plus_username
password: my_new_sql_plus_password
On Oracle VM side, I've set up my network as the screenshot shows
When I connect my VM I have the same IP as the database.yml file above
All that looks fine (I've followed every steps of this tutorial and also tried this one ), but when I try my rake db:setup command or to access the db via OCI8.new("my_new_sql_plus_username", "my_new_sql_plus_password", "//192.168.2.170:1521:1521/orcl"), I have the following error message.
rake aborted!
ORA-12170: TNS:Connect timeout occurred
oci8.c:267:in oci8lib_191.bundle
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:326:in `new'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:326:in `new_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:436:in `initialize'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:24:in `new'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:24:in `initialize'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_connection.rb:9:in `new'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_connection.rb:9:in `create'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced_base_ext.rb:13:in `oracle_enhanced_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-oracle_enhanced-adapter-1.4.3/lib/active_record/connection_adapters/oracle_enhanced.rake:26:in `create_database_with_oracle_enhanced'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `block (3 levels) in <top (required)>'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `each'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `block (2 levels) in <top (required)>'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
/Users/stephanethomas/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create
Thanks in advance for your help
I figured it out. So couple of problems:
First the network config. Use Bridged adapter instead of NAT, like below
Second, the config file in the rails app (database.yml), don't forget the 2 slashes in front of the IP ...
development:
adapter: oracle_enhanced
host: //192.168.2.170:1521/myprogram_development
username: my_new_sql_plus_username
password: my_new_sql_plus_password
And it's all good !

Error - Ruby OCI8 - Wrong number of arguments (2 for 0..1)

When running this script:
require 'oci8'
conn = OCI8.new('username', 'password', 'tnsname')
cursor = conn.exec('SELECT 1+1 FROM dual')
while r = cursor.fetch()
puts r.join(',')
end
cursor.close
conn.logoff
The following error message occurs:
C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `initi
alize': wrong number of arguments (2 for 0..1) (ArgumentError)
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:36:in `new'
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:36:in `require'
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:36:in `require'
from C:/tech/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5-x86-mingw3
2/lib/oci8.rb:81:in `<top (required)>'
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:60:in `require'
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:60:in `rescue in require'
from C:/tech/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
:35:in `require'
from u:/Ruby/test_oci_connect.rb:1:in `<main>'
I can use those credentials in SQLPLUS and I have both the gems and devkit installed. Can anyone assist with this issue or provide some clarity regarding the answer below?
The issue is caused by a mismatch in the Oracle DLLs architecture and your Ruby installation, or your System not finding the right DLLs.
Download the Oracle Instant Client. Its important that its the same arch that your Ruby is in, as it contains the necessary DLLs.
Unzip it somewhere on your HDD, such as:
C:/OracleInstantClient Its also convenient to add both
/network/admin/sqlnet.ora
/network/admin/tnsnames.ora to that folder.
Add the Instant Client's location to your System PATH. You should now be able to connect without that error, provided you've added the correct connection information.
I was getting the same error message, using a gem dependent on ruby-oci8 (dm-oracle-adapter for datamapper).
Re-ran the install as per these instructions on a fresh environment :
Installing instant client for ruby-oci8
Double checked the path was set correctly and restarted my ruby console.
And everything worked perfectly.
On the machine it didn't work on (above incorrect arguments error), I have Oracle 64 bit dlls installed for some other services. My theory is that it was conflicting with these dlls (Ruby-oci8 needs 32bit DLLs), even though there was nothing pointing to these in the path.
Also, if you get the warning "ext/oci8 not found" when running 'gem install ruby-oci8', let me save you some time. In my case, this was a red herring and didn't affect the function of the gem at all.
That problem doesn't seem related to OCI8 at all.
You are misleading us a little here by not showing the whole code.
From your error stack trace, I can tell that you have a class that's trying to initialize but you have defined a parameter to that method and you didn't mention it when creating your object.
What this really means is that you mentioned 2 parameters where it was expecting either nothing or just one parameter.
if you create a test.rb fiel and paste the code you show us above all by itself, does it work?

Twitter suggestions returning 404?

Running Twitter gem version 1.7.2, OSX Lion, Ruby 1.9.2.
In Rails console.. if you put:
client = Twitter::Client.new(:oauth_token => actual_token_here, :oauth_token_secret => actual_secret_here)
client.suggestions('entertainment')
It retrieves results from Twitter's API. But:
client = Twitter::Client.new
client.suggestions('entertainment')
Returns the same error:
Twitter::NotFound: GET https://api.twitter.com/1/users/suggestions/entertainment.json: 404: Can't find that category
https://dev.twitter.com/docs/api/1/get/users/suggestions/%3Aslug suggests that you don't need to be authenticated to make this API call.
So shouldn't it work without the tokens as well? The strange this is, I've asked someone else to do this on their dev machine and it works fine. I don't know where to proceed from here. How can I track where the problem is coming from?
This is the full trace:
Twitter::NotFound: GET https://api.twitter.com/1/users/suggestions/entertainment.json: 404: Can't find that category
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/faraday/response/raise_http_4xx.rb:16:in `on_complete'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/response.rb:9:in `block in call'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/response.rb:62:in `on_complete'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/response.rb:8:in `call'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/request/url_encoded.rb:14:in `call'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/request/multipart.rb:13:in `call'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/faraday/request/multipart_with_file.rb:18:in `call'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/connection.rb:203:in `run_request'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.4/lib/faraday/connection.rb:85:in `get'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/request.rb:27:in `request'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/request.rb:6:in `get'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/client/user.rb:117:in `suggestions'
from (irb):2
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
from /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in
Errr. for some reason, I needed to specify the lang param. For example:
client.suggestions("entertainment", :lang => "en")
Works now!

undefined method `cache_sweeper' for ActionController::Base:Class - warbler

I am deploying my Jruby Rails application on glassfish with acts_as_audited as a gem/plugin installed.
Whenever I try to Audit my model, I am going to get the following error.
My Environment is: Jruby 1.6.0.RC2, Rails 3.0.3
You can refer here if you guys want to look more on the error http://www.ruby-forum.com/topic/1053934
Please help me out, I stuck up here
Application Error
org.jruby.rack.RackInitializationException: undefined method `cache_sweeper' for ActionController::Base:Class
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/acts_as_audited-2.0.0.rc6/lib/acts_as_audited.rb:44:in `class_eval'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/acts_as_audited-2.0.0.rc6/lib/acts_as_audited.rb:44
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/acts_as_audited-2.0.0.rc6/lib/acts_as_audited.rb:68:in `require'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `require'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from /home/dev2/glassfishv3/glassfish/domains/domain1/applications/gavel/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
... 20 levels...
I reported this problema as a bug in jruby-rack.
A workaround is to add require 'active_record' if defined? $servlet_context after require 'rubygems' in config/boot.rb or manually including sweeping somwhere in application.rb ActionController::Base.send(:include, ActionController::Caching::Sweeping) if defined? $servlet_context.
I think I recognise this problem. It looks like acts_as_audited uses cache sweepers. I've had this problem with cache sweepers.
You need to explicitly include the caching module in your ApplicationController:
class ApplicationController < ActionController::Base
# JRuby not finding cache sweeper at runtime in production
include ActionController::Caching::Sweeping if defined?(JRUBY_VERSION)
# Rest of your class here...
end
I'm not sure why this happens, but it's probably a loading/resolution issue related to running in threadsafe mode for production.