ruby-on-rails - 安装 sqlite3 gem rvm openssl 权限被拒绝时出错

标签 ruby-on-rails linux sqlite rvm opensuse

Linux 新手。通过 rvm 安装 Ruby 2.0 和 rails 4.0。让它在我的笔记本电脑上使用 linux ubuntu 工作,但在我的工作计算机上使用 linux openSUSE 时出现问题。

已安装 rvm、ruby 和 rails。创建了一个 Rails 应用程序,但是当我运行 bundle install 时,我得到了这个:

**Errno::EACCES: Permission denied - /home/alf/.rvm/gems/ruby-2.0.0-p247/gems/sqlite3-1.3.8/API_CHANGES.rdoc
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.**

在运行 bundle install 时也得到了这个:

**Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    /home/alf/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/alf/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/
        --enable-local
        --disable-local
Gem files will remain installed in /home/alf/.bundler/tmp/10121/gems/sqlite3-1.3.8 for inspection.
Results logged to /home/alf/.bundler/tmp/10121/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.**

我安装了 sqlite3,但不知道它是否安装在本地某处。我是 linux 和 openSUSE 的新手。请帮助我。

当我运行 gem install sqlite3 -v '1.3.8' 时,我得到:

**ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /home/alf/.rvm/gems/ruby-2.0.0-p247/gems/sqlite3-1.3.8/API_CHANGES.rdoc**

这让我发疯,谷歌但找不到有效的解决方案。

最佳答案

我在 Ubuntu 上遇到了同样的错误,试图启动一个新的 Rails 项目。在这种情况下,sqlite3.h 丢失了,这意味着 libsqlite3-dev 丢失了,我猜(我是 Ubuntu 和 Sqlite3 的新手)。答案可以在这里找到:Installing sqlite headers .

~$ sudo apt-get install sqlite3
~$ sudo apt-get install libsqlite3-dev
~$ bundle install

在那之后,rails server 对我来说运行良好。我在本地主机上有我的欢迎加入

关于ruby-on-rails - 安装 sqlite3 gem rvm openssl 权限被拒绝时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18483479/

相关文章:

Python-SqlAlchemy : Filter query by great circle distance?

iphone - 如何从iPhone应用程序存储和查询远程数据?

ruby-on-rails - 为什么 Rails 控制台不会加载对 ruby​​ 文件的更改

jquery - 如何使用jquery在rails中加载html片段?

linux - Live Linux grep 脚本 - 只打印肯定的结果

sqlite - 社区Sqlite无法正确处理日期和日期时间

ruby-on-rails - 在 accept_nested_attributes_for 中无法访问 attr_accessor

javascript - angular-rails-templates 加载模板失败

linux - bash 脚本需要读取用户输入并将其用作另一个命令的参数

linux - 在 Linux 中,我如何知道是否收到了某个 TCP 数据包的 ACK?