2013-09-30 227 views
0

我是Rails的newby,我正在開發一些3.2.0的應用程序。所以,一切都很好,它適用於我的本地環境,但是當我嘗試將其推送到Heroku時,資源出現問題 - 我的css文件不能編譯到一個application.css文件中,因此我的最終application.css很乾淨(你可以通過鏈接my app on Heroku看到它)。我的本地機器上沒有問題。我發現一些答案的谷歌和人建議做以下命令:Rails 3.2預編譯失敗

RAILS_ENV=production bundle exec rake assets:precompile 

我試圖做到這一點,得到了以下的輸出:

/Users/marya/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/marya/.rvm/gems/[email protected]/bin/rake assets:precompile (LoadError) 
rake aborted! 
Command failed with status (1): [/Users/marya/.rvm/rubies/ruby-1.9.3-p448/b...] 
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:9:in `ruby_rake_task' 
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task' 
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>' 
/Users/marya/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:14:in `eval' 
/Users/marya/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:14:in `<main>' 
Tasks: TOP => assets:precompile 
(See full trace by running task with --trace) 

我不明白它的意思,所以我需要你的幫助。我的Gemfile:

source 'https://rubygems.org' 

gem 'rails', '3.2.0' 
gem 'bootstrap-sass', '2.1' 
gem 'bcrypt-ruby', '3.0.1' 
gem 'faker', '1.0.1' 
gem 'will_paginate', '3.0.3' 
gem 'bootstrap-will_paginate', '0.0.6' 
# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 
group :development, :test do 
    gem 'sqlite3', '1.3.5' 
    gem 'rspec-rails', '2.11.0' 
end 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '3.2.5' 
    gem 'coffee-rails', '3.2.2' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer' 

    gem 'uglifier', '1.2.3' 
end 

gem 'jquery-rails', '2.0.2' 

group :test do 
    gem 'capybara', '1.1.2' 
    gem 'factory_girl_rails', '4.1.0' 
end 

group :production do 
    gem 'pg', '0.12.2' 
    gem 'rails_12factor' 
end 
# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

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

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 

如果你需要另一個項目文件,請告訴我關於它,我會做。提前致謝!

+0

我覺得你有一些RVM和紅寶石的問題,當你輸入「這RVM」和「紅寶石其中發生了什麼「? – Kamilski81

回答

-1

似乎是一個RVM怪癖。我就遇到了這個使用RVM +紅寶石2.0.0-P247,這爲我工作:

rvm [email protected] do gem install executable-hooks