【问题标题】:Laravel 5 - Install TwitterOAuth library by AbrahamLaravel 5 - Abraham 安装 TwitterOAuth 库
【发布时间】:2015-06-17 01:53:47
【问题描述】:

我正在尝试使用 composer 在 laravel 5 中安装 abraham 的 twitteroauth 库 (https://github.com/abraham/twitteroauth)。像这样在 composer.json 中添加项目

"require": {
    "laravel/framework": "5.0.*",
    "php": ">=5.4.0",
    "abraham/twitteroauth": "0.5.2"
},

当我运行 composer update 时,我在最后收到一个错误

- Installing abraham/twitteroauth (0.5.2)
  Loading from cache

Writing lock file
Generating autoload files

[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()

Script php artisan clear-compiled handling the post-update-cmd event returned with an error

[RuntimeException]
Error Output:

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]

欢迎任何帮助

【问题讨论】:

  • 嗨,Amit,不相关但你考虑过 Laravel 5 的原生社交模块吗? github.com/laravel/socialite 这提供了 twitter oAuth 身份验证作为 Laravel 5 Auth 实现的一部分。
  • 感谢@DavidBarker 将尝试社交名流模块

标签: laravel twitter-oauth


【解决方案1】:

这不是您正在安装的库的问题。

当 Laravel v5.0.16 发布时,编译后的脚本位置发生了变化,upgrade guide was released.不幸的问题是,通过运行作曲家更新,您将升级到 5.0.16,而不知道任何这些,因此您需要打开 bootstrap/autoload.php 并更改 $compiledPath 变量。

// Change the current variable to this instead
$compiledPath = __DIR__.'/../vendor/compiled.php';

这会让它再次为您工作。

【讨论】:

  • 之前没有注意到这一点。但是在全新安装中运行 composer update 时会收到相同的错误。因此,“composer create-project laravel/laravel laravel5”,然后在安装“composer update”后出现同样的错误。编译路径与您指定的一样。
  • 删除供应商目录并在解决问题后运行 composer update。感谢您的帮助
  • 运行 composer dump-auto load 可以解决这个问题,抱歉没有早点看到这个问题。
猜你喜欢
  • 2012-05-18
  • 1970-01-01
  • 1970-01-01
  • 2015-09-25
  • 1970-01-01
  • 1970-01-01
  • 2015-07-11
  • 2015-11-16
  • 1970-01-01
相关资源
最近更新 更多