2010-04-29 144 views
0

使用以下指南開始使用rails for ubuntu 9.10。 http://guides.rails.info/getting_started.htmlruby​​ on rails配置

我已經安裝了ruby和gem。


戈庫爾@戈庫爾膝上型:〜$紅寶石-v 紅寶石1.8.7(2009-06-12 PATCHLEVEL 174)[1486-的linux] 戈庫爾@戈庫爾膝上型:〜$寶石-v 1.3.6 戈庫爾@戈庫爾-筆記本電腦:〜$


鋼軌,


戈庫爾@戈庫爾-筆記本電腦:〜$ sudo的創業板安裝導軌


似乎沒有給出任何迴應。 因此使用了突觸包管理器來安裝它。它似乎已經正確安裝。


戈庫爾@戈庫爾-筆記本電腦:〜$軌 用法:在/ usr/bin中/導軌/路徑/到/你/應用[選項]

選項: -r,--ruby =路徑到您選擇的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) 

Rails的信息:

-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應用程序你指定的路徑。

例子: 軌〜/代碼/紅寶石/博客

This generates a skeletal Rails installation in ~/Code/Ruby/weblog. 
See the README in the newly created application to get going. 

戈庫爾@戈庫爾-筆記本電腦:〜$


app文件夾中的所有文件夾正確創建。這個問題用下面的命令啓動......


戈庫爾@戈庫爾-筆記本電腦:〜$ sudo的創業板安裝戈庫爾捆綁

[須藤]密碼:

成功安裝捆綁-0.9。 24

1寶石安裝

用於捆綁-0.9.24安裝文件裏...

安裝的RDoc文檔捆綁-0.9.24 ...

戈庫爾@戈庫爾-筆記本電腦:〜$捆綁安裝

無法定位的Gemfile

戈庫爾@戈庫爾-筆記本電腦:〜$


來到數據庫,默認的sqlite3似乎已經正確安裝。


戈庫爾@戈庫爾-筆記本電腦:〜$ sqlite3的

SQLite的版本3.6.16

輸入 「幫助」 中的說明

輸入與終止SQL語句 「;」

sqlite的>


歡迎乘坐頁面不能夠在(http://localhost:3000)執行以下命令後發現 ...


戈庫爾@戈庫爾,筆記本電腦:〜/ 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 

戈庫爾@戈庫爾-筆記本:〜/桌面$ CD博客

戈庫爾@戈庫爾-筆記本:〜/桌面/博客$耙分貝:創建

(在/ home /戈庫爾/桌面/博客)

戈庫爾@戈庫爾-筆記本:〜/桌面/博客$軌服務器

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 

戈庫爾@戈庫爾-筆記本:〜/桌面/博客$


,希望有人可以幫我這個...

+0

您試圖安裝哪個版本的導軌? – tommasop 2010-04-29 11:06:28

+0

您是否嘗試過使用ruby腳本/服務器代替rails服務器? – khmarbaise 2010-04-29 11:07:31

+0

@tommasop:rails版本:2.2.3-1(已經使用突觸包管理器安裝)。 @khmarbaise:yey !!非常感謝你...它的工作原理...訥路...笏是問題嗎? – Themasterhimself 2010-04-29 11:16:14

回答

1

如果你想開始在Ubuntu 9.10的Rails的穩定版本,我建議:

刪除通過apt,或者一樣安裝任何寶石和檢查RubyGems是至少在1.3.5版本。

gem -v 
sudo gem install sqlite3-ruby rails # will install Rails 2.3.5 = latest stable release 
rails app 
cd app 
rake db:create 
script/server 

如果你想手動學習Rails 3中(目前beta3版)

刪除通過apt,或者一樣安裝RubyGems包並安裝RubyGems的1.3.6。

wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz 
tar xfz rubygems*tgz 
cd rubygems-* 
sudo ruby setup.rb && cd .. 
gem -v 
# if gem command fails 
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem 

sudo gem install sqlite3-ruby bundler rails -pre 
# will install Rails 3.0.0beta3 
rails app 
cd app 
bundle install 
rake db:create 
rails server 
0

安裝捆綁和應用的啓動

bundle install 

步驟之前生成的Rails應用程序,你需要cd到軌之後有:

gem install bundler 
rails blog 
cd blog 
bundle install 
+0

不...還有同樣的問題... ------------ gokul @ gokul-laptop:〜/ Desktop $ sudo gem install bundler --- 已成功安裝bundler-安裝0.9.24 --- 1寶石--- 用於捆綁-0.9.24 ...---- 安裝RDoc文檔裏安裝文檔捆綁-0.9.24 ...---- 戈庫爾@戈庫爾-筆記本:〜/桌面$軌博客---- 創造--- 創建應用程序/控制器---- 創建應用程序/傭工--- 創建應用程序/模型---- 。 。 。 戈庫爾@戈庫爾-筆記本:〜/桌面$ CD博客---- 戈庫爾@戈庫爾-筆記本:〜/桌面/博客$捆綁安裝--- 無法定位的Gemfile – Themasterhimself 2010-04-29 11:27:51

1

要運行服務器類型:

./script/server 

不要:

rails server 

rails在當前目錄中創建新的Rails項目。

+1

軌服務器(或軌道S)是針對Rails 3的! – 2010-04-29 12:05:15

+0

@Rouben:thanx,我不知道,但它會在不久的將來非常有用! – klew 2010-04-29 14:14:02

0

如果你仍然有問題...只是嘗試這個包初始化。這將創建GemFile。