2011-12-10 52 views
8

我添加了twitter-bootstrap-rails寶石,並做了捆綁安裝。然後我去做:Twitter引導軌 - 找不到發電機

rails g bootstrap:install 

這似乎並不工作,並說它找不到發生器。

Could not find generator bootstrap:install. 

我在軌道上3.1。爲什麼這不起作用?

編輯:嘿,不知道,如果你想整個的Gemfile,但在這裏它是:

source 'http://rubygems.org' 

gem 'rails', '3.1.0' 
gem 'sorcery' 
gem 'heroku' 
gem 'will_paginate' 
gem "pg", :group => :production 
gem 'sqlite3' 
gem 'acts_as_api' 
gem 'taps' 
gem 'twitter-bootstrap-rails' 


# Bundle edge Rails instead: 
# gem 'rails',  :git => 'git://github.com/rails/rails.git' 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', " ~> 3.1.0" 
    gem 'coffee-rails', "~> 3.1.0" 
    gem 'uglifier' 
end 

gem 'jquery-rails' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

group :development do 
    # To use debugger 
    gem 'ruby-debug19', :require => 'ruby-debug' 
end 

group :test do 
    # Pretty printed test output 
    gem 'turn', :require => false 
end 

和寶石列表:

*** LOCAL GEMS *** 

abstract (1.0.0) 
actionmailer (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
actionpack (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
activeadmin (0.3.2) 
activemodel (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
activerecord (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
activerecord-jdbc-adapter (1.2.0) 
activerecord-jdbcmysql-adapter (1.2.0) 
activerecord-jdbcsqlite3-adapter (1.2.0) 
activeresource (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
activesupport (3.1.1, 3.1.0, 3.0.7, 3.0.1, 3.0.0) 
acts_as_api (0.3.11) 
addressable (2.2.6) 
annotate-models (1.0.4) 
ansi (1.4.1, 1.3.0) 
archive-tar-minitar (0.5.2) 
arel (2.2.1, 2.0.9, 1.0.1) 
autotest (4.3.2) 
autotest-fsevent (0.2.4) 
autotest-growl (0.2.9) 
autotest-rails-pure (4.1.0) 
bcrypt-ruby (3.0.1) 
builder (3.0.0, 2.1.2) 
bundler (1.0.12) 
chronic (0.6.4) 
cocaine (0.2.0) 
coffee-rails (3.1.1) 
coffee-script (2.2.0) 
coffee-script-source (1.1.3, 1.1.2) 
columnize (0.3.5, 0.3.4) 
commonjs (0.2.0) 
cucumber (1.1.0) 
daemons (1.1.3) 
devise (1.4.8) 
diff-lcs (1.1.3, 1.1.2) 
erubis (2.7.0, 2.6.6) 
eventmachine (0.12.10) 
execjs (1.2.9) 
factory_girl (1.3.3) 
factory_girl_rails (1.0) 
faker (0.3.1) 
faraday (0.7.5, 0.6.1) 
fastercsv (1.5.4) 
formtastic (1.2.4) 
gherkin (2.5.2) 
gravatar_image_tag (0.1.0) 
has_scope (0.5.1) 
heroku (2.15.1, 2.8.5) 
hike (1.2.1) 
i18n (0.6.0, 0.5.0, 0.4.2) 
inherited_resources (1.2.2) 
jdbc-mysql (5.1.13) 
jdbc-sqlite3 (3.7.2) 
jquery-rails (1.0.19, 1.0.18, 1.0.16) 
json (1.6.3, 1.6.1) 
kaminari (0.12.4) 
launchy (2.0.5) 
less (2.0.8) 
less-rails (2.0.1) 
libv8 (3.3.10.4 x86_64-darwin-10) 
linecache19 (0.5.12) 
log4r (1.1.9) 
macaddr (1.4.0) 
mail (2.3.0, 2.2.19) 
meta_search (1.1.1, 1.1.0.pre, 0.9.8) 
mime-types (1.17.2, 1.16) 
multi_json (1.0.4, 1.0.3) 
multi_xml (0.4.1) 
multipart-post (1.1.4, 1.1.3) 
net-ldap (0.2.2) 
nokogiri (1.5.0, 1.4.4) 
oa-basic (0.3.0) 
oa-core (0.3.0) 
oa-enterprise (0.3.0) 
oa-more (0.3.0) 
oa-oauth (0.3.0) 
oa-openid (0.3.0) 
oauth (0.4.5) 
oauth-plugin (0.4.0.pre7) 
oauth2 (0.5.1, 0.4.1) 
omniauth (0.3.0) 
orm_adapter (0.0.5) 
paperclip (2.4.4) 
pg (0.11.0) 
polyamorous (0.5.0) 
polyglot (0.3.3, 0.3.2, 0.3.1) 
pyu-ruby-sasl (0.0.3.3) 
rack (1.3.5, 1.3.4, 1.2.4, 1.2.2) 
rack-cache (1.0.3) 
rack-mount (0.8.3, 0.6.14) 
rack-openid (1.3.1) 
rack-ssl (1.3.2) 
rack-test (0.6.1, 0.5.7) 
rails (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
railties (3.1.0, 3.0.7, 3.0.1, 3.0.0) 
rake (0.9.2.2, 0.9.2, 0.8.7) 
rdoc (3.11, 3.10) 
responders (0.6.4) 
rest-client (1.6.7) 
rspec (2.6.0, 2.0.1) 
rspec-core (2.6.4, 2.0.1) 
rspec-expectations (2.6.0, 2.0.1) 
rspec-mocks (2.6.0, 2.0.1) 
rspec-rails (2.6.1.beta1, 2.0.1) 
ruby-debug-base19 (0.11.25) 
ruby-debug19 (0.11.6) 
ruby-openid (2.1.8) 
ruby-openid-apps-discovery (1.2.0) 
ruby_core_source (0.1.5) 
rubygems-update (1.7.2) 
rubyntlm (0.1.1) 
rubyzip (0.9.5, 0.9.4) 
sass (3.1.11, 3.1.10) 
sass-rails (3.1.5, 3.1.4, 3.1.0) 
sequel (3.20.0) 
sinatra (1.0) 
sorcery (0.7.5) 
spork (0.8.4) 
sprockets (2.0.3, 2.0.2) 
sqlite3 (1.3.4, 1.3.3) 
sqlite3-ruby (1.3.3, 1.2.5) 
sys-uname (0.8.6, 0.8.5) 
systemu (2.2.0) 
taps (0.3.23) 
term-ansicolor (1.0.7, 1.0.6) 
therubyracer (0.9.9) 
thin (1.2.11) 
thor (0.14.6) 
tilt (1.3.3) 
treetop (1.4.10, 1.4.9) 
turn (0.8.3) 
twitter-bootstrap-rails (1.4.0) 
tzinfo (0.3.31, 0.3.30, 0.3.27) 
uglifier (1.1.0, 1.0.3) 
uuid (2.3.4) 
warden (1.0.6) 
webrat (0.7.1) 
will_paginate (3.0.2, 3.0.pre2) 
XMLCanonicalizer (1.0.1) 
+0

你可以顯示你的'Gemfile'嗎? – htanata

+0

看起來正確。你能提供一份你的'Gemfile'和'gem list'的輸出嗎? –

+0

當您輸入「rails g」時,您獲得的發電機列表是什麼? –

回答

1

看着你的寶石文件,我認爲你需要指定一個引導寶石的版本,特別是v1.3.0或之前:https://rubygems.org/gems/twitter-bootstrap-rails/versions/1.3.0

檢查相對於當前版本1.4.1的依賴關係。或者,升級到rails 3.1.1。

+0

試過了。至少有一個不同的錯誤:'method_missing':未定義的方法'less'for#(NoMethodError) 和一堆其他東西 –

+0

我升級到了rails 3.1.1,似乎在做伎倆。謝謝 –

+0

得愛上流血的邊緣。 :D –

1

很奇怪,我使用Ruby 1.9.2和Rails 3.1(Ubuntu 11.10),並沒有發現任何問題。我跟着嘗試重現你的問題的步驟如下:

rails new tb_example 
cd tb_example 
gedit Gemfile 

包含在Gemfile中

以下行
gem 'twitter-bootstrap-rails' 

然後安裝包並安裝引導

bundle install 
rails g bootstrap:install 

一切工作正常。

如果您想嘗試一下我的示例項目只是告訴我,我會找出如何將它傳送給你,讓你可以執行最後一步「軌摹引導:安裝」​​,看看它是否工作或不

+0

我剛剛創建了一個新的rails項目,將gem添加到gemfile中,然後運行rails g bootstrap:install並出現相同的錯誤。現在我很困惑。 –

+1

對不起,我無法重現您的問題。也許你可以嘗試執行'bundle update'然後'bundle install'。 – Alberto

+0

是的,我試過。沒有工作。這是最隨機的問題 –

4

我有同樣的問題。

嘗試在關閉導軌服務器的情況下運行rails g bootstrap:install。這似乎爲我做了詭計。

0

1)編輯由開口的Gemfile: 「納米的Gemfile」

2.)更新Twitter的自舉-導軌通過添加:寶石 「推 - 引導-軌道」,「〜> 1.3.0「 - 其中」〜> 1.3.0「反映了最新版本。

- 最新版本可在this頁面的底部找到。

3.)運行「軟件包安裝」