开发者

RoR development-environment setup

I'm interested to play around with RoR a bit. Apart from literat开发者_JAVA百科ure i should read, i'm particularly interested about how to setup development environment.

Here's a good example how to setup environment for Java from Noda Time project wiki pages.

I want something similar but for RoR.

As far as i know - unix operation systems fits way much better (have toyed on windows 1 1/2 year ago - pure nightmare). So it would be nice to get some recommendations about linux distros and how to make it run next to win7/xp.

Basically - i want to shorten endless searching and improvisation until i can play with some code.

P.s. bonus for simple sample project. :)


The single quickest way to get up and running might be to simply grab Netbeans and develop against its built-in JRuby instance. It will walk you through setting up a Rails project and even give you some nice-to-haves like autocompletion.

Baring that, the easiest method is likely to download a Linux VM Appliance pre-Customized for Rails Development and a copy of VMWare Player.


The best 2 ways to go are OS X and Linux, I use Ubuntu just because it's the nicest package that I've found (there will no doubt be a variety of opinons on this.)

For Rails, I like to not use the packages or pre-installed versions, and instead build my own so I can test against various versions of ruby if need be. Hivelogic has a nice post about how to do it for OS X 10.6.

From there, you can just run:

rails myproject
cd myproject
./script/generate scaffold post title:string body:text
rake db:migrate
rm public/index.html
./script/server --debugging

And then connect to http://localhost:3000/posts to get to your application.

Once you get more comfortable, check out running Passenger instead, so you can have multiple applications running at the same time. On OSX there's even a nice Prefpane to easily set up new sites. This also ins't too hard in Ubuntu with the examples provided in the passenger docs.

For editing the application I think the IDEs (Aptana, Netbeans, etc.) are still too heavyweight, especially for small starter projects. I like Textmate (like everyone else) for OSX and gedit with gedit-mate.

Once you're writing applications, you'll find that railsapi has the best interface for browsing all of the various methods not only in Rails, but ruby, authlogic, and a bunch of other common gems.

Lastly, you'll want to look into source control, with git being preferred in the Rails community at the moment.

Good luck!


  • Get VMWare player
  • Get ubuntu vm
  • If it's server version - install desktop x or whatever it's called
  • Mess around with sudos, visudos
  • Mess around with vi editor to save newly created account to sudoers list
  • Mess around with vertical mouse scrolling which apparently does not work on vmware+ubuntu
  • Finally install netbeans
  • Through plugins, install ruby on rails
  • Some global updating
  • Enjoy toying

tadaaaa...

Something like that i wanted - with each point explained a bit (no doubt that my steps aren't best ones and sounds funny for those who knows).

I guess that i forgot to mention that i lack knowledge of unix systems in general too.

Anyway - got what i was looking for. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜