Is there a simple way to tell if a Gem will work in Rails3? - ruby-on-rails-3

I wanted to use this gem:
https://github.com/PRX/apn_on_rails
Finally, after digging through the issues, seems it's not Rails3 ready (yet). Is there some simple way of finding is something is Rails 3 compatible without digging all over?
Thanks!

Aside from creating a fresh Rails app and giving it a try, I tend to look at the commit messages of forks created by other users (i.e. https://github.com/PRX/apn_on_rails/network). In this instance, it looks like there is a fork that runs on Rails 3 that is still being maintained.

Generally, if it isn't mentioned in the readme (on github) then no. Most gems I have used explicitly specify rails 2 and rails 3 install instructions. If this is not the case, then usually someone else will have asked this question and a quick search will reveal.
One other giveaway is the install instructions. The rails 2 way of installing a gem via a Gemfile is:
config.gem GEMNAME
The rails 3 way is:
gem 'apn_on_rails'
This answer is related to the gem you are looking for.

Related

Hard time installing Ruby on Rails because of different RVM versions

I'm following Michael Hartl's Ruby on Rails tutorial book and am trying to install rails. As the book says, I followed the instructions on InstallRails.com and got through most of it until I was told to run rails server and I kept getting the error that I didn't have railties gem not installed. I had initially ran sudo gem install rails and so I read that it didn't pick up railties for some reason but gem install rails did - so that fixed it. So now I was able to run rails server and the app was live.
I returned to the book and as the instructions say, I generated a new rails app, specifying the rails version (4.2.2). However, when I run rails again, I get errors. At this point, having tried a dozen different stackover flow solutions, I feel like I must have screwed up the files and maybe I should just get rid of rails completely and try installing from scratch.
Here's some information on where I'm currently at:
Faiques-MacBook-Pro:Desktop Faique$ rails -v
Rails 4.2.3
Faiques-MacBook-Pro:Desktop Faique$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Faiques-MacBook-Pro:Desktop Faique$ mkdir workspace
Faiques-MacBook-Pro:Desktop Faique$ cd workspace
Faiques-MacBook-Pro:workspace Faique$ rails _4.2.2_ new hello_app/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (= 4.2.2) - did find: [railties-4.2.3] (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/ ubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/rails:22:in `<main>'
I'm not sure what other information I should provide.
This isn't an ideal solution but what I ended up doing was completely restoring my mac and then reinstalling rails but using rbenv instead as per a friend's recommendation. I am now set up with Rails.
I wanted to do a complete restore (deleting all my data) because I had tried so many stack overflow answers for different errors - including using sudo for certain commands - that I'm sure I had messed some important settings and would take a long time to figure out. I think this was surprisingly one of the more efficient solution, although far from ideal.

Where's a Gemfile.apk tutorial? Or the default Gemfile.apk gems?

Ruboto rules like no Android development environment has ruled before. It's like the best of Rails combined with the best of the standard Eclipse-Java-Android environment.
Oh, except it's too new & green to even have tutorials or workarounds or even newbie QA in the forums.
For example, I can install Ruboto, and run it, until I try to add a gem to my application. The instructions seem to say to write a Gemfile.apk text file, and put your gem calls in it.
The problems start when I add a gem to that file:
source "http://rubygems.org"
gem 'wrong'
Then the system starts requesting other gems, such as thor, sqlite3, and Rails. Sometimes, it starts complaining about the versions of sdoc and rdoc. That's a story for another post. The upshot is the system asks for gem files one at a time, and expects specific versions.
This leaves me curious where a "master Gemfile.apk" is. So I can get into it, maybe bundle-install it, and I can stop screwing around with versions & mismatches and s--t.
The versions are ruby 1.9 to 2.1.1, and Ruboto 1.0.3.
A long question with many parts :) I'll try to cover all, but feel free to file an issue in the Ruboto tracker or ask on the mailing list or on the IRC channel if you need more info ( http://ruboto.org/community.html ).
You can find tutorials here:
https://github.com/ruboto/ruboto/wiki/Tutorials-and-examples
You can find the FAQ here:
https://github.com/ruboto/ruboto/wiki/FAQ
Tutorials showing use of Gemfile.apk:
https://github.com/ruboto/ruboto/wiki/Tutorial%3A-Using-Bundler
https://github.com/ruboto/ruboto/wiki/Tutorial%3A-Using-an-SQLite-database-with-ActiveRecord
https://github.com/ruboto/ruboto/wiki/Tutorial%3A-write-a-gosu-game
There is no "master Gemfile.apk". Only the gems in the Gemfile.apk and their dependencies should be installed into libs/bundle.jar and included in your app.
I hope this helps you get going. If you see opportunities for improving the documentation, we are open for contributions.

Is it possible to deploy rails3 and rails4 in the same server?

I just want to know if is possible to deploy to passenger a project that I have in rails3 (ruby-1.9.3) and another project in rails4 (ruby-2.0.0). I have installed ruby using RVM on my production server, I'm just wondering if is going to be possible to have 2 different projects on the same production server.
Regards
No problem in that, but there're couple things that you need to do first.
Install nginx instead of Apache and use it with unicorn. You can find a whole lot of setup guides depending on your production server OS, or use the capistrano-nginx-unicorn gem if you use Capistrano for deployment.
Use the rvm-capistrano gem to manage the ruby versions and gemsets used in each project. It's pretty well documented, but if you have further questions, feel free to ask.
If you'll need any further help, you may also consider asking on the freenode#rvm channel. I found some great hints there.

Does Radiant support Rails 3 now?

I use gem install radiant to install radiant, and I found that it doesn't support Rails 3. But, I found there is a file named "GemfileRails3" in the source code of Radiant on Github, I wonder why is that. Does Radiant really not support Rails3?
Radiant still does not support Rails 3 at this moment. A lot of work towards that has been done, but the project is lacking momentum, making it hard to say when this can be released.

Gem for sorting and searching

I am using rails version 3.2.6. I have to use the gem for sorting and searching for the index pages in my application. I know about jquery-datatables-rails gem. I just want to know if there is some other gem for sorting and searching that is supported in rails 3.2.6. I had also searched for datagrid gem but did not get the proper ducumentation for that and if it(datagrid) is supported in rails 3.2.6.
Active Scaffold (https://github.com/activescaffold/active_scaffold) is probably over top, or? Its my most-used-gem. Of course it has sorting and searching build in, configurable and fast. Check it out, following the getting started guide in the wiki you should have an app up and running in 10 minutes.