TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Help me improve my Rails 3 Environment. Please.

8 点作者 Rhodee将近 14 年前
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.<p>How would you improve it?<p>Here is what I have installed<p>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.<p>Here are my steps -- Thanks for the feedback!<p>Create Rails App, Database &#38; 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<p>module ::applicationName class Application include Rake::DSL end end<p>module ::RakeFileUtils extend Rake::FileUtilsExt end<p>(5) Run rake db:create:all (optional)<p>(6) Run rails g scaffold modelName attr:DataType..<p>(7) Add to route.rb root :to =&#62; 'resource#action'<p>(8) Run rake db:migrate<p>(9) Go to migrate folder and confirm contents of date_create_resource.rb<p>(10) Add gem "rake", "~&#62; 0.9.2" to Gemfile<p>Set up jQuery, Compass and Finish Up<p>(11) Run compass init rails add generated statement to Gemfile<p>(12)<p>Add gem "jquery-rails", "~&#62; 1.0.12" to Gemfile (13)<p>Run rails generate jquery:install --ui (14)<p>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...<p>(15) Place js references in ERB file &#60;%= javascript_include_tag"javascripts/jquery.min.js"%&#62; &#60;%= javascript_include_tag "javascripts/jquery-ui.min.js"%&#62; &#60;%= javascript_include_tag "javascripts/jquery-ui.min.js"%&#62;<p>(16) Review, update Gemfile (jQuery,rake, compass)<p>(17) Update the compass.rb file<p>(18) Run bundle install<p>(19) Restart the server sudo apachectl graceful

2 条评论

prognostikos将近 14 年前
You can do 95% of this (excluding Apache configuration) automatically with Rails templates.<p>My example is here <a href="https://github.com/prognostikos/rails_templates/blob/master/basic.rb" rel="nofollow">https://github.com/prognostikos/rails_templates/blob/master/...</a> and if you search github you can find many more.<p>Use with 'rails new yourapp --template=path/to/template'
评论 #2816640 未加载
lenary将近 14 年前
no 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)
评论 #2816626 未加载