how to make the ruby on rails with mysql environment in ubuntu 11.04.
I use the
sudo apt-get install ruby
sudo apt-get install mysql-server
Then I try
gem install rails
But I do not know to to install the mysql adapter?
Is there a document which I can follow?
Update:
Now,I install the gems use
gem install rails.
There are no errors.
However when I run
rails -v
I got ‘rails’ is not installed,you can typing sudo apt-get install rails
However when I change to the rails bin directory,and use the ruby to run the rails script,I can get the version:
xx@mac:/$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
xx@mac:/$ cd /var/lib/gems/1.8/bin/
xx@mac:/var/lib/gems/1.8/bin$ ruby rails -v
Rails 3.2.1
xx@mac:/var/lib/gems/1.8/bin$
So,it seems that this is caused that the ‘rails’ can not be run directly,how to fix it?
You’d better use RVM to manage your Rubies and Gems instead of the distro’s Ruby.
See RVM documentation : http://www.beginrescueend.com/rvm/basics/
As soon as you have RVM and a Ruby interpreter installed, install the rails gem (with MRI 1.9.2 and a gemset called “your_gemset”) :
Generate your Rails project, then update the Gemfile (in your project directory) : remove the sqlite3 adapter entry and replace it with the mysql2 adapter :
Finally, edit your database.yml file with your MySQL configuration.