To create a new Web App with rails just type in:
rails new <project-name>
For example:
rails new blog
To create a new Web App with rails just type in:
rails new <project-name>
For example:
rails new blog
Rails is the most popular Web Framework for Ruby. You can install it via GEMs.
sudo gem1.9 install rails
GEM is a pretty cool packaging system for Ruby apps. Take a look to http://rubygems.org.
Usually it is installed together with ruby. You can update your gems with this command:
sudo gem1.9 update --system
Here is the user guid: http://docs.rubygems.org/read/book/1
On Mac OS X Ruby 1.8.X is already pre-installed. But if you want to have the newest version 1.9.X you have to install it again. I assume that you installed already XCode and MacPorts on your machine. Than you have update your MacPorts
sudo port selfupdate
All right. Now you can install the newest version.
sudo port install ruby19
That’s it. Now you have to versions of Ruby on your computer. Check the version.
ruby1.9 --version
You should see something like this here:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11]
I am a Java guy. I have nearly 10 years experience with Java. I have build high scale able Web Apps with Java, Spring, Struts, JSF, Hibernate, JDBC, Ant, Maven2, JUnit and some other crazy Frameworks.
Now I want to try out something new. I am playing around with Ruby, Rails, Gem, Rake and all the other Ruby Tools. My First impression. To install the newest version of Ruby and Rails on a Mac, it is a pain in the ass!
Ruby 1.8.2 is already pre installed on Mac OS X Snow Leopard. With MacPorts you can install pretty easy the version 1.9.1.
sudo port install ruby19
A more detailed tutorial you can find here: Tutorial
Over rubygems I fetched the newest version of the Rails Framework, 3.0.4. Then I try to use it, I get this Message:
Rails 3 doesn't officially support Ruby 1.9.1 since recent stable releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2. You're running ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10]
All right! No Problem. I am a big boy. I can install the newest version 1.9.2 from the source code. Just download the sourcecode for Ruby 1.9.2 and compile & build it from the source:
./configure make make test make install
The command “ruby –version” now shows me:
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
All right. Looks good. Trying again to use rails. “rails –version”. Still get the same Message:
Rails 3 doesn't officially support Ruby 1.9.1 since recent stable releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2. You're running ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10]
Hm. I am pretty sure I have version 1.9.2 on my Mac! How to tell Rails to use the newest version?
Any Ideas ???