Rails(I)Win7 Environment
1. download and install rails
download and install ruby
http://rubyforge.org/frs/download.php/75127/rubyinstaller-1.9.2-p290.exe
>ruby -v
ruby 1.9.2p290
download and install rubygems
http://rubyforge.org/frs/download.php/74953/rubygems-1.8.5.zip
unzip the file and execute the command in the directory
d:\tool\rubygems-1.8.5>ruby setup.rb
download and install rails
d:\download>gem install rails --pre --no-ri --no-rdoc --include-dependencies
>gem install sqlite3-ruby
download and install sqlite
http://www.sqlite.org/download.html
I got these files:
sqlite-analyzer-win32-x86-3070701.zip
sqlite-dll-win32-x86-3070701.zip
sqlite-shell-win32-x86-3070701.zip
And I unzip them and copy all the files to this directory D:\tool\Ruby192\bin
2. Try a sample
d:\work\rails>rails new example
change the directory to the newly create directory
>cd example
>bundle install
>bundle update
>rake db:migrate
error message:
rake aborted!
uninitialized constant Rake::DSL
D:/tool/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
solution:
find the file Rakefile, and change it as follow:
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
#require File.expand_path('../config/application', __FILE__)
#Example::Application.load_tasks
require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition'
module ::Example
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
Example::Application.load_tasks
>bundle update
>rake db:migrate
>rails server
But it seems so slow when I run rails server. And I can not visit http://localhost:3000
references:
http://rubyonrails.org/
http://www.hashemzahran.com/riding-the-rails-installing-ruby-on-rails/
http://accidentaltechnologist.com/ruby-on-rails/running-rails-3-on-windows/
https://gist.github.com/4cd2bbe68f98f2f0249f
1. download and install rails
download and install ruby
http://rubyforge.org/frs/download.php/75127/rubyinstaller-1.9.2-p290.exe
>ruby -v
ruby 1.9.2p290
download and install rubygems
http://rubyforge.org/frs/download.php/74953/rubygems-1.8.5.zip
unzip the file and execute the command in the directory
d:\tool\rubygems-1.8.5>ruby setup.rb
download and install rails
d:\download>gem install rails --pre --no-ri --no-rdoc --include-dependencies
>gem install sqlite3-ruby
download and install sqlite
http://www.sqlite.org/download.html
I got these files:
sqlite-analyzer-win32-x86-3070701.zip
sqlite-dll-win32-x86-3070701.zip
sqlite-shell-win32-x86-3070701.zip
And I unzip them and copy all the files to this directory D:\tool\Ruby192\bin
2. Try a sample
d:\work\rails>rails new example
change the directory to the newly create directory
>cd example
>bundle install
>bundle update
>rake db:migrate
error message:
rake aborted!
uninitialized constant Rake::DSL
D:/tool/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
solution:
find the file Rakefile, and change it as follow:
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
#require File.expand_path('../config/application', __FILE__)
#Example::Application.load_tasks
require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition'
module ::Example
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
Example::Application.load_tasks
>bundle update
>rake db:migrate
>rails server
But it seems so slow when I run rails server. And I can not visit http://localhost:3000
references:
http://rubyonrails.org/
http://www.hashemzahran.com/riding-the-rails-installing-ruby-on-rails/
http://accidentaltechnologist.com/ruby-on-rails/running-rails-3-on-windows/
https://gist.github.com/4cd2bbe68f98f2f0249f