Ruby on rails 即使在bundle安装后也无法使用gem

Ruby on rails 即使在bundle安装后也无法使用gem,ruby-on-rails,ruby,linux,gem,Ruby On Rails,Ruby,Linux,Gem,我正在Linux机器上创建一个项目 当我执行捆绑安装时,它会安装所有gem,但当我尝试使用gem时,它会给我一个错误,并建议我再次执行捆绑安装 命令和输出如下: saurabh@my-linux:~/beacon$ bundle install Using addressable 2.3.8 Using execjs 2.0.2 Using json 1.8.3 Using autoprefixer-rails 6.0.3 Using backports 3.6.6 Using sass 3.

我正在Linux机器上创建一个项目

当我执行
捆绑安装时
,它会安装所有gem,但当我尝试使用gem时,它会给我一个错误,并建议我再次执行
捆绑安装

命令和输出如下:

saurabh@my-linux:~/beacon$ bundle install

Using addressable 2.3.8
Using execjs 2.0.2
Using json 1.8.3
Using autoprefixer-rails 6.0.3
Using backports 3.6.6
Using sass 3.2.19
Using bootstrap-sass 3.2.0.2
Using buftok 0.2.0
Using coffee-script-source 1.9.1.1
Using coffee-script 2.2.0
Using daemons 1.2.3
Using rack 1.5.5
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using rufus-scheduler 2.0.24
Using rack-protection 1.5.3
Using tilt 1.4.1
Using sinatra 1.4.6
Using multi_json 1.11.2
Using rack-test 0.6.3
Using sinatra-contrib 1.4.6
Using hike 1.2.3
Using sprockets 2.10.2
Using eventmachine 1.0.8
Using thin 1.6.4
Using thor 0.18.1
Using dashing 1.3.4
Using unf_ext 0.0.7.1
Using unf 0.1.4
Using domain_name 0.5.25
Using equalizer 0.0.10
Using multipart-post 2.0.0
Using faraday 0.9.2
Using http-cookie 1.0.2
Using http-form_data 1.0.1
Using http_parser.rb 0.6.0
Using http 0.9.8
Using memoizable 0.4.2
Using naught 1.1.0
Using netrc 0.7.9
Using rest_client 1.8.3
Using simple_oauth 0.3.1
Using twitter 5.15.0
Using bundler 1.10.6
Updating files in vendor/cache
Bundle complete! 5 Gemfile dependencies, 44 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

saurabh@my-linux:~/beacon$ bundle show dashing

/usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4

saurabh@my-linux:~/beacon$ /usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/bin/dashing start

/usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/lib/dashing/cli.rb:1:in `require': no such file to load -- thor (LoadError)
    from /usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/lib/dashing/cli.rb:1
    from /usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/bin/dashing:6:in `require'
    from /usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/bin/dashing:6

saurabh@my-linux:~/beacon$ dashing start

Could not find addressable-2.3.8 in any of the sources
Run `bundle install` to install missing gems.

saurabh@my-linux:~/beacon$ /usr/lib/lib/ruby/gems/2.1.0/gems/dashing-1.3.4/bin/dashing start

Could not find addressable-2.3.8 in any of the sources
Run `bundle install` to install missing gems.
我做错了什么?

听起来有两种选择:

  • 捆绑安装后,您没有重新启动服务器,请重新启动
  • 您使用
    sudo
    来安装gems,因此它们以
    root
    的身份安装给所有linux用户,因此它们实际上不在您的源代码路径中,请在此处阅读更多信息:
  • 听起来有两种选择:

  • 捆绑安装后,您没有重新启动服务器,请重新启动
  • 您使用
    sudo
    来安装gems,因此它们以
    root
    的身份安装给所有linux用户,因此它们实际上不在您的源代码路径中,请在此处阅读更多信息:

  • 请不要滥用粗体文字;这就像把所有东西都写成大写一样糟糕。相反,请使用更多的注释,并将键入的命令格式化为与收到的输出相同的格式。@theTinMan:已编辑,谢谢。
    /use/lib/lib
    非常可疑,可能是问题所在。应该只有一个
    lib
    。我怀疑是您强制执行了路径,而不是允许安装转到它认为应该安装的位置。Ruby和gem也可能因此而混淆。也许一个开始的问题应该是“如何正确安装Ruby?”请不要滥用粗体文本;这就像把所有东西都写成大写一样糟糕。相反,请使用更多的注释,并将键入的命令格式化为与收到的输出相同的格式。@theTinMan:已编辑,谢谢。
    /use/lib/lib
    非常可疑,可能是问题所在。应该只有一个
    lib
    。我怀疑是您强制执行了路径,而不是允许安装转到它认为应该安装的位置。Ruby和gem也可能因此而混淆。也许一个开始的问题应该是“如何正确安装Ruby?”安装gems后不一定要重新启动Linux服务器。重新启动单个应用可能会有所帮助,但通常在
    捆绑包安装成功后才会启动。安装gems后不一定要重新启动Linux服务器。重新启动单个应用程序可能会有所帮助,但通常在
    捆绑包安装成功后才会启动这些应用程序。