Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm Ruby on Rails 3 compatibility. #18

Closed
mrrooijen opened this issue Jul 14, 2010 · 9 comments
Closed

Confirm Ruby on Rails 3 compatibility. #18

mrrooijen opened this issue Jul 14, 2010 · 9 comments
Labels

Comments

@mrrooijen
Copy link
Contributor

Have not yet tested Backup on Rails 3. Noticed there was a branch that was working on it, but seems to be inactive at the moment and never received a pull request. Will look into this soon.

If anyone has Backup running with Rails 3 at the moment, please comment below.

@boblmartens
Copy link

What do you need to know? I can do some testing if I know what I should be looking for.

@yorzi
Copy link

yorzi commented Jul 31, 2010

I was trying backup on Rails3, I encountered the following errors when starting the server, not sure is the bug in backup or in bundler:

FYI.
/Users/andy/proj.workspace/youyang/ruby/1.8/gems/backup-2.3.2.pre3/lib/backup.rb:32:in join': can't convert nil into String (TypeError) from /Users/andy/proj.workspace/youyang/ruby/1.8/gems/backup-2.3.2.pre3/lib/backup.rb:32 from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:64:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:64:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:62:ineach'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:62:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:51:ineach'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler/runtime.rb:51:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0.rc.1/lib/bundler.rb:109:inrequire'
from /Users/andy/proj.workspace/youyang/config/application.rb:7
from /Users/andy/proj.workspace/youyang/ruby/1.8/gems/railties-3.0.0.rc/lib/rails/commands.rb:28:in require' from /Users/andy/proj.workspace/youyang/ruby/1.8/gems/railties-3.0.0.rc/lib/rails/commands.rb:28 from /Users/andy/proj.workspace/youyang/ruby/1.8/gems/railties-3.0.0.rc/lib/rails/commands.rb:27:intap'
from /Users/andy/proj.workspace/youyang/ruby/1.8/gems/railties-3.0.0.rc/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6

@boblmartens
Copy link

I'll try and get on this one this week and see if I can get it to happen on a clean install of Rails 3. RVM rules!

@mrrooijen
Copy link
Contributor Author

RVM rules indeed! But man I gotta say I really love the UNIX adapter more than the Rails one. Cause Rails becomes a dependency, but it's a nice plug and play feature. However I actually never use it that way anymore. Always do a clean UNIX adapter install.

Hopefully new features will be out fairly soon which will enable multiple databases and storage locations at the same time. That'd really be an awesome addition!

@mrrooijen
Copy link
Contributor Author

I am currently working on implementing Ruby on Rails 3 support. This is one big drama lama haha. I have to rename modules/constants because RAILS_ROOT is deprecated and I'm trying to use Rails.root. But since we declare Backup::Environment::Rails it basically overrides it.

Then the next issue occurred! Namely that the Rails constant is not being set because the rake tasks execute the Backup gem while it's already loaded, meaning that we get this: Rails # => Uninitialized Constant

To fix this I have wrapped the whole top of lib/backup.rb that should initialize in a Proc.new block so it doesn't get executed right off the bat. We will now have a new class/method we must invoke after loading the Rails environment:

Backup::System.boot!

Which loads everything basically. So also for UNIX environment, this will be added in the bin file. But this was quite a bitch to get working, but as far as I can see after I solved the issue, Backup just worked!

I'm probably pushing a rails3 branch soon so anyone that's interested can check it out. The idea is to support both Rails 2, Rails 3 and Unix in a single gem.

@mrrooijen
Copy link
Contributor Author

For what would be placed in the bin file.

require 'rubygems'
require 'backup'

puts Backup::System.boot!
puts current_environment

outputs:

true
unix

So Backup::System.boot! will be used in the bin as well!

@mrrooijen
Copy link
Contributor Author

Also started working on Ruby on Rails 3 generators. These have pretty much already been implemented so these will be included in the Rails3 branch.

@mrrooijen
Copy link
Contributor Author

Started the rails3 branch!
http://github.com/meskyanichi/backup/commits/rails3

Added Rails 3 Generator:
d7455f6

Added Rails 3 Compatibility for Backup:
504ed21

@mrrooijen
Copy link
Contributor Author

Merged into master, released gem 2.4.0 - Ruby on Rails 3 support.

Closed by 102b97d

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants