【发布时间】:2011-02-13 18:24:51
【问题描述】:
我使用以下指南开始使用 ubuntu 9.10 的 rails。 http://guides.rails.info/getting_started.html
我已经安装了 ruby 和 gem。
gokul@gokul-laptop:~$ ruby -v ruby 1.8.7 (2009-06-12 补丁级别 174) [i486-linux] gokul@gokul-laptop:~$ gem -v 1.3.6 gokul@gokul-laptop:~$
对于轨道,
gokul@gokul-laptop:~$sudo gem install rails
似乎没有给出任何回应。 所以使用突触包管理器来安装它。而且它似乎已经正确安装了。
gokul@gokul-laptop:~$ rails 用法:/usr/bin/rails /path/to/your/app [选项]
选项: -r, --ruby=path 您选择的 Ruby 二进制文件的路径(否则脚本使用 env,调度程序当前路径)。
Default: /usr/bin/ruby1.8
-d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3/frontbase/ibm_db).
Default: sqlite3
-D, --with-dispatchers Add CGI/FastCGI/mod_ruby dispatches code to generated application skeleton
Default: false
--freeze Freeze Rails in vendor/rails from the gems generating the skeleton
Default: false
-m, --template=path Use an application template that lives at path (can be a filesystem path or URL).
Default: (none)
轨道信息:
-v, --version Show the Rails version number and quit.
-h, --help Show this help message and quit.
常规选项:
-p, --pretend Run but do not make any changes.
-f, --force Overwrite files that already exist.
-s, --skip Skip files that already exist.
-q, --quiet Suppress normal output.
-t, --backtrace Debugging: show backtrace on errors.
-c, --svn Modify files with subversion. (Note: svn must be in path)
-g, --git Modify files with git. (Note: git must be in path)
说明: 'rails' 命令创建一个新的 Rails 应用程序,并使用默认值 您指定的路径中的目录结构和配置。
示例: rails ~/Code/Ruby/weblog
This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.
gokul@gokul-laptop:~$
app 文件夹是使用所有正确的文件夹创建的。问题从以下命令开始...
gokul@gokul-laptop:~$ sudo gem install bundler
[sudo] gokul 的密码:
成功安装 bundler-0.9.24
已安装 1 个宝石
正在为 bundler-0.9.24 安装 ri 文档...
正在为 bundler-0.9.24 安装 RDoc 文档...
gokul@gokul-laptop:~$ 捆绑安装
找不到 Gemfile
gokul@gokul-laptop:~$
来到数据库,默认的sqlite3好像已经安装正确了。
gokul@gokul-laptop:~$ sqlite3
SQLite 版本 3.6.16
输入“.help”获取说明
输入以“;”结尾的 SQL 语句
sqlite>
执行以下命令后,在 (http://localhost:3000) 处找不到欢迎登机页面...
gokul@gokul-laptop:~/Desktop$ rails 博客
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create db/seeds.rb
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
gokul@gokul-laptop:~/Desktop$ cd blog
gokul@gokul-laptop:~/Desktop/blog$ rake db:create
(在 /home/gokul/Desktop/blog)
gokul@gokul-laptop:~/Desktop/blog$ rails 服务器
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create db/seeds.rb
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
gokul@gokul-laptop:~/Desktop/blog$
希望有人能帮我解决这个问题...
【问题讨论】:
-
您尝试安装哪个版本的 Rails?
-
你试过用 ruby script/server 代替 rails server 吗?
-
@tommasop:rails 版本:2.2.3-1(已使用突触包管理器安装)。 @khmarbaise:是的!非常感谢...有效...新方法...问题出在哪里?
-
您正在使用指南安装 rails 3.0 但安装的是 rails 2.2.3,所以 khmarbaise 是对的,但是脚本/服务器将不再用于 3.0,而是您需要使用 rails 服务器
-
那么我应该怎么做才能将其转换为 3.0?
标签: ruby-on-rails ruby configuration installation rubygems