4 ms·
Ask HN: Help me improve my Rails 3 Environment. Please.
I am new to ruby, played with Sinatra now want to try Rails 3. I am setting up my environment and came up with a checklist.
How would you improve it?
Here is what I have installed
Rake .9.2
Compass 0.11.5
Rails 3.0.7
Passenger 3.0.7
+ a host of dependencies. My goal is to create an environment with Compass Framework, Passenger and jQuery.
Here are my steps -- Thanks for the feedback!
Create Rails App, Database & Server Instance
(1)
Run rails new prjName --using blueprint
(2)
Is httpd.conf file pointing to right file?
(3)
Delete /public/index.html.erb
(4)
Update Rakefile if using Rake 0.9.2
module ::applicationName
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
(5)
Run rake db:create:all (optional)
(6)
Run rails g scaffold modelName attr:DataType..
(7)
Add to route.rb root :to => 'resource#action'
(8)
Run rake db:migrate
(9)
Go to migrate folder and confirm contents of date_create_resource.rb
(10)
Add gem "rake", "~> 0.9.2" to Gemfile
Set up jQuery, Compass and Finish Up
(11)
Run compass init rails add generated statement to Gemfile
(12)
Add gem "jquery-rails", "~> 1.0.12" to Gemfile
(13)
Run rails generate jquery:install --ui
(14)
Run compass init rails (to generate a sass folder)? I should not have to do this? Any Compass Users please help me understand why this is the case...
(15)
Place js references in ERB file
<%= javascript_include_tag"javascripts/jquery.min.js"%>
<%= javascript_include_tag "javascripts/jquery-ui.min.js"%>
<%= javascript_include_tag "javascripts/jquery-ui.min.js"%>
(16)
Review, update Gemfile (jQuery,rake, compass)
(17)
Update the compass.rb file
(18)
Run bundle install
(19)
Restart the server sudo apachectl graceful
- prognostikos 15y agoYou can do 95% of this (excluding Apache configuration) automatically with Rails templates. My example is here https://github.com/prognostikos/rails_templates/blob/master/basic.rb https://github.com/prognostikos/rails_templates/blob/master/... and if you search github you can find many more. Use with 'rails new yourapp --template=path/to/template'
- Rhodee 15y ago@prognostikos - thanks man. I saw your template and came across a few others. I came across this gem (https://github.com/kfaustino/rails-templater https://github.com/kfaustino/rails-templater) I might give it a go. I understand about 85% of your script so I am definitely going to try and create my own from all this inspiration.
- lenary 15y agono need to restart the server. if you're using passenger, just `$ touch tmp/restart.txt` (in your rails app). That will restart just that app in passenger (and lots of other servers too)
- Rhodee 15y ago@lenary thank you very much for your feedback. I recall reading about the restart.txt - what contents should be in this file or is it generated?