2011-12-10 53 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.)运行“软件包安装”