Showing posts with label Rails IDE. Show all posts
Showing posts with label Rails IDE. Show all posts

Sunday, August 23, 2009

Rails IDE : Installing Aptana Radrails 1.30 into Eclipse Galileo

For Radrail users who would like to use it within Eclipse Galileo, you may want to follow this simple tutorial :-

1. Download Eclipse 3.50 aka Galileo

2. Launch Eclipse

3. Click Help/Install Software

4. Install Aptana Studio 1.5 as a plug into Eclipse



5. Install Aptana Radrails via Aptana Studio




6. Open Aptana Radrails Perspective via Windows/Open Perspective/Others


7. After opening a Rails Project

Saturday, August 22, 2009

Rails IDE: Can Radrails be installed into Eclipse ? {Updated 30th August 2009]

I would answer Yes and No this question :-)

Yes, you can install Radrails directly to Eclipse (I use Eclipse Ganymade aka 3.4.2) but you ended up with the obsolete 0.72 version :-(

To install the latest 1.30 developed by Aptana and known as Aptana radrails, I was forced to install Aptana Studio and then Install Aptana Radrails

Still, the effort was worth it as the loading time for Eclipse Ganymade SDK version + Aptana Radrails loads much faster and runs faster than Aptana 1.51 Studio + Aptana Radrails.

BTW, take a look at my actual experience in installing Aptana Radrails into Eclipse Galileo aka 3.50

Tuesday, August 18, 2009

Rails IDE: Programming a Rails Project Using Aptana Radrails (Updated 11th Jan 2017)

Update on 11/1/17 : Aptana Rdrails does not work with Rails 5

Here are the steps that I took when programming a RoR project using Aptana Rails 1.5 on Ubuntu 9.04

1. Use MySQL Administrator to create a new database crm2009
2. Use Aptana Radrails(defaulted to Radrails perspective) to create new project via
a) File
b) New
c) Rails Project
and the standard Rail Page was launched apparently without any error

d) Checked Console and found the folowing error message
/!\ FAILSAFE /!\ Tue Aug 18 18:03:01 +0800 2009
Status: 500 Internal Server Error
Access denied for user 'root'@'localhost' (using password: NO)

3. Edited config\database.yml to put in mysql password and the problem went away


Installing Rails Plugin

The problem with Aptana Radrails is that being Eclippse 3.2-based, it does not support installing from the github although using the Rails Plugin Tab works with svn. Worst still, using console script/plugin install also does not work :-(

So what's the workaround ?

Opening a Terminal Window, i was force to type
git clone to download to
crm2009\vendor\plugins

In this manner, I installed restul_authentication,role_requirement,acts_as_audited,active_scaffold etc

Then, I selected vendor\plugins and right-clicked to Refresh and the desired plugins are now in the Ruby Explorer


Installing restful_authentication
a) Select Generate Tab
b) Select authenticated
c)Type user session in parameters
d) Click OK

In the Console, we can see this

script/generate authenticated user sessions
Ready to generate.
----------------------------------------------------------------------
Once finished, don't forget to:

- Add routes to these resources. In config/routes.rb, insert routes like:
map.signup '/signup', :controller => 'users', :action => 'new'
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'

----------------------------------------------------------------------

We've create a new site key in config/initializers/site_keys.rb. If you have existing
user accounts their passwords will no longer work (see README). As always,
keep this file safe but don't post it in public.

----------------------------------------------------------------------
exists app/models/
exists app/controllers/
exists app/controllers/
exists app/helpers/
create app/views/sessions
exists app/controllers/
exists app/helpers/
create app/views/users
exists config/initializers
exists test/functional/
exists test/functional/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create app/controllers/sessions_controller.rb
create app/controllers/users_controller.rb
create lib/authenticated_system.rb
create lib/authenticated_test_helper.rb
create config/initializers/site_keys.rb
create test/functional/sessions_controller_test.rb
create test/functional/users_controller_test.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
create app/helpers/sessions_helper.rb
create app/helpers/users_helper.rb
create app/views/sessions/new.html.erb
create app/views/users/new.html.erb
create app/views/users/_user_bar.html.erb
create db/migrate
create db/migrate/20090818114130_create_users.rb
route map.resource :session
route map.resources :users
route map.signup '/signup', :controller => 'users', :action => 'new'
route map.register '/register', :controller => 'users', :action => 'create'
route map.login '/login', :controller => 'sessions', :action => 'new'
route map.logout '/logout', :controller => 'sessions', :action => 'destroy'
>

Then, select db/migrate/yymmddhhmmss_create_users.rb
Right-click, select Rake/db/migrate and hit enter an in the Rails Console

rake db:migrate
== CreateUsers: migrating ====================================================
-- create_table("users", {:force=>true})
-> 0.0108s
-- add_index(:users, :login, {:unique=>true})
-> 0.0122s
== CreateUsers: migrated (0.0246s) ===========================================

>

script/generate mailer user
exists app/models/
create app/views/user
exists test/unit/
create test/fixtures/user
overwrite app/models/user.rb? (enter "h" for help) [Ynaqdh] Y
force app/models/user.rb
overwrite test/unit/user_test.rb? (enter "h" for help) [Ynaqdh] Y
force test/unit/user_test.rb

Installing role_requirement

script/generate roles Role User
Generating Role against User
Added the following to the top of app/models/user.rb:



# ---------------------------------------
# The following code has been generated by role_requirement.
# You may wish to modify it to suit your need
has_and_belongs_to_many :roles

# has_role? simply needs to return true or false whether a user has a role or not.
# It may be a good idea to have "admin" roles return true always
def has_role?(role_in_question)
@_list ||= self.roles.collect(&:name)
return true if @_list.include?("admin")
(@_list.include?(role_in_question.to_s) )
end
# ---------------------------------------




Added ApplicationController include to /home/chee/Aptana Studio Workspace/crm2009/app/controllers/application_controller.rb
Added RoleRequirement include to /home/chee/Aptana Studio Workspace/crm2009/app/controllers/application_controller.rb
create test/fixtures/roles.yml
create app/models/role.rb
create lib/role_requirement_system.rb
create lib/role_requirement_test_helper.rb
create lib/hijacker.rb
exists db/migrate
create db/migrate/20090818131928_create_roles.rb
>

Then, select db/migrate/yymmddhhmmss_create_roles.rb
Right-click, select Rake/db/migrate and hit enter an in the Rails Console


rake db:migrate
== CreateRoles: migrating ====================================================
-- create_table("roles")
-> 0.0652s
-- create_table("roles_users", {:id=>false})
-> 0.0066s
-- add_index("roles_users", "role_id")
-> 0.0123s
-- add_index("roles_users", "user_id")
-> 0.0486s
== CreateRoles: migrated (0.1342s) ===========================================

>

More to come...

Sunday, August 16, 2009

Rails IDE : How to Install a Plugin in Aptana RadRails Professional ?

My last project using RoR was completed in Nov 2007 on a Windows 2003 Server and it has been functioning perfectly 24x7x365 till todate

Having installed Ubuntu 9.04 on a dated IBM R40e (1G RAM & 75G HDD), I had earlier
a) Installed Ruby on Rails
b) Installed Aptana Studio 1.5 (based on Eclipse 3.2) and found that it needed Sun JRE
c) Installed Sun JRE via Ubuntu's Terminal
d) Installed the RADRails Plugin into Aptana Studio 1.5
e) I then defaulted Aptana Studio to the RadRails Perspective

Since ActiveScaffold was intensively used, I naturally downloaded it and was at a loss as how to install it :-( Then, I remembered that there was a Plugins Tab which should be visible but it wasn;t there :-(

With a bit of exploring Aptana, I click Window/Show View and clicked Rails Plugin and bingo, the Rails Plugin Tab became visible. It was a breeze after that :-(

Tuesday, February 17, 2009

Announcements : Radrails 1.1.2 Released

by cwilliams » Wed Feb 04, 2009 9:45 pm


RadRails 1.1.2 has been released to stable. Users who are on 1.1.1 are recommended to upgrade. Aptana should prompt you to automatically upgrade if you're on 1.1.1. To manually install (for users of older releases, or those experiencing problems) the update site is: http://update.aptana.com/update/rails/3.2/


The changelog for this release is at: http://support.aptana.com/asap/browse/ROR/fixforversion/10153


This is a bugfix only release.

Sunday, November 18, 2007

Announcements : Aptana Radrails 0.9.1 Final Release

For Radrails users, there is happy news !

Aptana RadRails 0.9.1 Final Release has been released since 15th November 2007. Users who are still on 0.8.0 are highly recommended to upgrade.

Here's the Trac changelog: http://www.aptana.com/trac/milestone/RadRails%20IDE%200.9.1 And the ASAP one: http://support.aptana.com/issues/browse/ROR/fixforversion/10004

Saturday, October 6, 2007

Rails IDE: I can't imagine why some people keep promoting Aptana

In a post on borland.public.3rdrail.ide, Joe McGlyn, Product Development Manager at CodeGear made this comment in response to one of my post.

Joe :
I've spent the past few days trying to use RadRails (the newest M7 from > Aptana). I'm certainly strongly biased toward 3rdRail

CCH: This is to be expected, no worries :-)>

Joe:
but I'm reasonably objective too. If someone points out a bug or >shortcoming in 3rdRail that is valid I'm inclined to agree. Example: Diego's questions about our debugger -- it's weak. Got it, we'll have something that will rock in our December update.

CCH: I have noticed that in your response to my posts. That's why I respect you.

Joe : I can't imagine why some people keep promoting Aptana.

CCH: I think they promote RdRails rather than AptanaBTW, I will start to compile from the various posts why they do that ...and post it on my Rails Blog.

Joe : First, code completion: Method completion fails with a null pointer exception EVERYWHERE. I created a new project, re-installed the IDE, made sure the paths to the Ruby interp. and Rails + Rake commands were set right and it still fails everywhere. I've tried simple cases like "self." in controllers and actions, and modelname. in views, they all fail.

CCH:Just type self.+ctrl+space and a list was displayed (with no errors)Please do not be offended but did you install properly. There is an article on my blog "Rails...Rails...Rails"at http://cch4rails.blogspot.com/ which went live only yesterday and yes 3rdRail is also promoted.

Joe: The usage model is weak. Having to go to a combo box on a tabbed pane is lame. Having separate panes for installing a plugin

CCH: I agree on the inflexibility of installing plugins from unregistered sources vs. running a rake taskcch: I like the Rake Tasks Tab as I find it very convenientvs. running a generator is really week.

CCH: I prefer 3rdRail's Model wizard but the generate tab does have a destroy option which can roll back a controller/model which was requested in the 3rdRail FieldTest but I am not sure whether this has been implemented

Joe : It's a poor usage model, way less effective than working from the OS command line. There also isn't a keystroke to get to these magic views so everything is mouse-based.

CCH: This has not bothered me at all :-)>

Joe :Never mind that the "generator" combo box is buggy (after a bit of usage it's empty and I have to re-start)

CCH: I also find this mildly annoying but you do not have to restart, just click the Refresh icon on the top LH corner of the Generator Tab

Joe : The "gem manager" doesn't have any way I can find to install a plugin (install is always greyed out). I can't install a gem from a specific URL or svn tag (so, for example, it's useless for getting the Rails 2.0 > preview release) I can't add additional repositories to install gems from. Like most of the UI it ends up being a lot less useful than the command line.

CCH: I have just done that whilst installing the ibRuby Gem :-)See my latest article on Interbase at "Rails...Rails..Rails"

Joe : At first glance the debugger seems promising, and they have a list of refactorings, although most don't look that useful for Rails development.

Based on my research on comments made in popular RoR-related groups, this why some people keep promoting Aptana radrails

1) Tim Harper (Project Member : Active Scaffold) , 30th Sept 2007

Lemme chime in here and say I love aptana radrails.

I tried 3rdRail, and it felt "clunky". The code complete is excellent in it, but it's also pretty slow.

Aptana's code complete, go to declaration, combined with eclipse's textual complete are great enough for me.

Plus, radrails gives you a neat little tool for running unit tests that kicks the pants off running them in a console window

http://groups.google.com/group/activescaffold/browse_thread/thread/afed31fe981b6fe6/30e6785209ce5c73#30e6785209ce5c73

2. Josh

So it was definitely a ruby version issue. For some reason I was still running verion 1.8.2. I just upgraded to 1.8.6 and adjusting the aptana to work with it and now its working beautifully.

I'm willing to bet the other guy with the mac is running an older version as well.
http://groups.google.com/group/activescaffold/browse_thread/thread/9dba7977c325e9f0/95ce778341d5c154?lnk=gst&q=Aptana&rnum=14#


3) Patrick Aljord (8th March 2007)


RadRails is the best free IDE out there for RubyOnRails development and it's easy for companies to integrate it into their development platforms as it it's based on Eclipse.
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/73dd6d73752aa09b/59504f9e3488b88c?lnk=gst&q=radrails&rnum=3#59504f9e3488b88c


4) Chris Bloom (29th September 2007)


I'm using RadRails since I can't spring $2049 for TextMate (and accompanying Mac). I've also tested the "e" editor, and otherwise have used EditPlus.

RadRails is a nice balance of a compact work space, console/logger, and syntax hilighter. I also like its Auto-completion functionality, but it's anywhere from complete OR consistent. And it's preferences panel leaves much to be desired. Then again, it is still a beta release so you have to take some of those problems in context. I look forward to future releases.

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/fc4ec10f4767e4aa/0cf12c2fd2e323e9?q=radrails&lnk=nl&

5) John Lane (24th Sept 2007)


Hmm, I'd never heard of 3rdRail so I just checked it out: it appears to be a commercial product.

I personally use Aptana and, yes it has its issues but I think it's better to support an open source initiative with a donation than walk off to a close source solution.

However, if 3rdRail is streets ahead of Aptana then it may be worth paying for. So, what does it give that Aptana doesn't

6) Dr Nic (6th Nov 2006)

RadRails is a wonderful IDE for developing Rails/Ruby, and supports a similar auto-completion mechanism to TextMate's snippets, called templates. You activate them by typing a portion of the template name, and pressing CTRL-SPACE.

But RadRails doesn't come with many templates for Rails development.
I've just finished porting all the TextMate snippets across to RadRails - about 250 of them. I hope they are useful to other RadRails developers!
http://drnicwilliams.com/2006/11/06/post-halloween-radrails-trick-all-textmate-snippets-available/
Nic

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/9dbdeb357234c895/a1f35635bb6441fb?lnk=gst&q=radrails&rnum=23#a1f35635bb6441fb


7) Jay Levitt (1st Oct 2007)

integration support. Both RadRails and 3rdRail use the Subclipse plugin (though I suppose either could be made to use Subversive instead), so you'll see no differences between them.

I'm fairly happy with Subclipse; it's a bit finicky, and there are some cases (reverting, especially) where it's much slower than the command line, but the integration with the core Eclipse feature set is really nice - the ability to see in your project which files need updating, the Synchronize mode, and especially Mylyn's ability to automatically create separate changesets for each of your to-do tasks. Two of my favorite features are the Eclipse Compare Editor graphical merge view and the "Quick Diff" annotation bar[2] (which colors the line-number field for each line based on revision number and author, making it easy to find change groups).

The Subclipse maintainer is also on the core Subversion team, so I'd expect Subclipse to have terrific support for the cool new upcoming features in 1.5, like first-class changesets and merge tracking. In fact, he's blogged about a GUI merge-tracking client he's been working on[3].

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/be1f7ce2af0a5f18/1b0e136ee6b6adb1?lnk=gst&q=radrails&rnum=60#1b0e136ee6b6adb1

Thursday, October 4, 2007

Rails IDE : Why is 3rdRail Unique ?

This is quoted verbatim from a response to post I made in the CodeGear 3rd Rail Public News Group.

CCH: As I delve deeper into eclipse-based IDEs such as 3rdRail & Radrails, I began to realise that a lot of features that developers rave about are actually from Eclipse. I am planning to write an impartial article (at > http://cch4rails.blogspot.com/) on why 3rdRail is so special, which I believe to be true to a certain degree. As such, I would appreciate it if you list the non-eclipse features that truly distinguishes 3rdRail from other IDEs .

Joe McGlyn, Director of Product Development, CodeGear :

Top level features:
- Rails Explorer
- Project Commander
- Ruby console
- Rails console
- Dependency view
- Rails refactorings (NB claims to have refactorings for views and actions, but it fails in every test case I've tried)
- Solid code completion (FWIW, I get a null pointer exception in RadRails M7 in nearly every test case on code completion -- not template completion)
- Context-aware templates (template expansion only shows templates for the current Rails context so you don't see view templates in a controller for example)
- "open associate" navigation according to Rails' dispatch rules

Tuesday, October 2, 2007

Rails IDE : Aptana Radrails M7 Beta - First Impressions

I am an intensive user of Aptana Radrails M5 since July 2007 and have just updated to M7.

Interface-wise, I can immediately see the following changes :-
1) Rails Navigator has been replaced by Ruby Explorer
2) 5 obviously new icons on the tool bar
a) H - switch to Helper
b) T - switch to Test
c) M - switch to Model
d) V - switch to Views
e) C- switch to Controller

Curious, I selected my favourite project and click (a) - (e), nothing happened

Then, I opened the CustomerController which looks the same as in M5

Clicking H opened module customers_helper.rb
Clicking M opened module customer.rb
Clicking V asked for which action (using AS, N/A)
Clicking T opened customer_controller_test.rb

This is very convenient, Cool :-)

3) Rails Plugin no longer automatically goto the home pages but links are clearly there thus speeding up

4) Code completion/Code Snippet when one type

val or validates+ctrl+space displays a list wnd when selected inserts
validates_presence_of(attributes, :message => "message")

5) The Ruby Explorer is great in that via a tree structure, methods hyperlinked to the actual methods. This is a nice feature absent in M5.

This article was first posted on 28th September 2007, 11:30pm on the Ruby on Rails:Talk Google Group

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/e4365a0d52403271#

Rails IDE : Aptana Radrails M7 Beta - Best Way To Upgrade

Just upgraded smoothly to long overdue Aptana M7 Beta which was released on 25/9/2007.

FYI, the best way to upgrade from July's M5 (M6 was skipped) is as follows :-

1) Click Help/Software Upgrades/Final and Install

2) Manually adding the following remote update site to the update manager: http://update.aptana.com/update/rails/beta/3.2/site.xml
Nb. Name the new remote site as say "Aptana M7 Update"

3) If you have any issue after upgrading, you could try to reinstall as follows :-
1) Remove the Aptana folder under C:\Documents and Settings\username\My Documents (if any)
2) Uninstall Aptana from Control Panel
3) Install from Aptana_IDE_Setup.msi
4) Goto Help\Software Updates\Find and Install
5) Accept the default Search for new features to install
6) Check Aptana M7 Beta and click Finish

This article was first posted on 28th September 2007, 10:48pm on the Ruby on Rails:Talk Google Group

Update on 4th October 2007

This is what I did to get a clean installation of RadRails
1) Uninstall va control panel
2) Delete Documents and Settings\username\mydocuments\Aptana Beta folder which contains the meta data
3) Remove the Programs\Aptana direcory
4) Install Aptana_IDE_setup.msi

Nb. You may want to chose custom and select to install JRE 1.6
I believe this is the source of your null pointer issue

5) Using Plugins Manager or Find and Install Software, install
- Radrails M7 Beta
- Subclipse

That's it

Welcome to Rails.. Rails... Rails !

In 1995, I started the popular Clipper...Clipper... Clipper website (no blogs then) which was very popular and linked by virtually every Clipper-related site. When I switched to Windows via Delphi in 1997, I started the Delphi... Delphi... Delphi site. In June 2007, I discovered Ruby on Rails and no prize for guessing what I am gonna name this blog. which I started on 2nd October 2007.

As at 10th June 2010, we have 13,364 unique visitors from more than 84 countries such as Angola, Andorra, Argentina, Australia, Austria, Algeria,Barbados, Bosnia and Herzogovina, Belgium, Brazil, Bulgaria, Bangladesh, Belarus, Bolivia, Chile, Cambodia, Cape Vede, Canada, China, Colombia, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Egypt, Estonia, Finland, France, Guadeloupe, Guatemala, Germany, Greece, Hong Kong, Hungary, India, Indonesia, Ireland, Israel, Italy, Japan, Kenya, Korea, Lithuania, Latvia, Malaysia, Mexico, Macao, Netherlands, Nepal, Norway, New Zealand, Oman, Panama, Peru, Poland, Portugal,Paraguay , Philippines, Romania, Russian Federation, Saudi Arabia, Singapore, Spain, Slovakia, Slovenia, Serbia, South Korea, Slovenia, South Africa, Spain, Switzerland, Sri Lanka, Sweden, Taiwan, Thailand, Turkey, United Arab Emirates, Ukraine, USA, UK, Venezuela, Vietnam

CCH
10th June 2010, 19:42