ism*_*sow 42 rubygems ruby-on-rails heroku bundler ruby-on-rails-3
我正在努力将我的代码推送到Heroku.在搜索Google和Stack Overflow问题后,我找不到解决方案.这是我尝试"git push heroku master"时得到的结果:
Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
Unresolved dependencies detected; Installing...
Fetching source index for http://rubygems.org/
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:300:in `open_uri_or_path': bad response Not Found 404 (http://rubygems.org/quick/Marshal.4.8/mail-2.2.6.001.gemspec.rz) (Gem::RemoteFetcher::FetchError)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:172:in `fetch_path'
.
....
Run Code Online (Sandbox Code Playgroud)
最后:
FAILED: http://docs.heroku.com/bundler
! Heroku push rejected, failed to install gems via Bundler
error: hooks/pre-receive exited with error code 1
To git@heroku.com:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:myapp.git'
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
Jac*_*cob 42
我不认为这是一个Rails版本问题,也不是特定于Heroku.(今天bundle install我在使用Rails 3.0.3在本地开发机器上运行时遇到了同样的问题.)
bundle update正如安德鲁所说,在本地运行可以解决问题.
编辑:正如评论中所建议:记住git add .,git commit -m "message"
小智 19
我有同样的问题: remote: ! Failed to install gems via Bundler.
如果你看到问题是这样的:
remote: Your bundle only supports platforms ["x86_64-darwin-16"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with `bundle loc
remote: --add-platform x86_64-linux` and try again.
Run Code Online (Sandbox Code Playgroud)
它的意思是:
Your bundle only supports platforms ["x86_64-darwin-16"] but your local platform is x86_64-linux. Add the current platform to the lockfile with `bundle loc --add-platform x86_64-linux` and try again.
Run Code Online (Sandbox Code Playgroud)
如果你在你的 gemfile.loc 中看到你只有这个:
PLATFORMS
x86_64-darwin-16
Run Code Online (Sandbox Code Playgroud)
所以我做了这个命令,在 gemfile.loc 中添加你的平台
bundle lock --add-platform x86_64-linux
Run Code Online (Sandbox Code Playgroud)
这将更新您的 Gemfile.loc :
PLATFORMS
x86_64-darwin-16
x86_64-linux
Run Code Online (Sandbox Code Playgroud)
继续 :
git add .
git commit -m "add platform x86_64-linux"
Run Code Online (Sandbox Code Playgroud)
再推
git push heroku master:main
Run Code Online (Sandbox Code Playgroud)
解决!
小智 6
另一个提示:打开 Gemfile.lock 并检查该块是否存在:
PLATFORMS
x86_64-darwin-20
Run Code Online (Sandbox Code Playgroud)
如果存在,则运行以下命令:
bundle config force_ruby_platform true
现在,您必须重新创建整个 Gemfile.lock,因为某些 gem 只能针对 MacOS 构建。因此,只需删除Gemfile.lock并运行bundle install(不要忘记停止 spring,如果它正在运行,否则 spring 会自动重新创建 Gemfile.lock 文件)
小智 6
bundle lock --add-platform ruby
bundle lock --add-platform x86_64-linux
bundle install
git add .
git commit -m "Bundler fix"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25487 次 |
| 最近记录: |