【发布时间】:2015-04-03 14:08:22
【问题描述】:
在本文底部发现的错误日志
我已关注this 教程系列,了解如何在 Cloud9 上制作 Ruby on Rails 应用程序,但遇到了障碍。
我到了可以通过 Cloud9 将代码部署到 Heroku 服务器的部分。为了做到这一点,教程的人建议将 Ruby 版本从默认的 2.1.5 更改为 2.1.4
部署顺利,网站在 Heroku 上运行良好,但现在我失去了在 Cloud9 上运行它的能力。请注意,我的 bash_profile 文件包含以下命令:
rvm use 2.1.4
source ~/.profile
任何想法为什么我会遇到这个问题?
日志:
Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.1.4/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.4'.
Using /usr/local/rvm/gems/ruby-2.1.4
Your code is running at https://foosite-foouser.c9.io.
Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.1.4/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.4'.
Using /usr/local/rvm/gems/ruby-2.1.4
Your Ruby version is 2.1.5, but your Gemfile specified 2.1.4
更新
rvm 列表输出:
foouser@foosite:~/workspace (master) $ rvm list
rvm rubies
ruby-1.8.7-p374 [ x86_64 ]
ruby-1.9.3-p547 [ x86_64 ]
=* ruby-2.1.4 [ x86_64 ]
ruby-2.1.5 [ x86_64 ]
# => - current
# =* - current && default
更新 2
运行rails s -b $IP -p $PORT的输出
=> Booting WEBrick => Rails 4.1.6 application starting in development on http://0.0.0.0:8080 => Run `rails server -h` for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) => Ctrl-C to shutdown server [2015-04-17 21:29:28] INFO WEBrick 1.3.1 [2015-04-17 21:29:28] INFO ruby 2.1.4 (2014-10-27) [x86_64-linux] [2015-04-17 21:29:28] INFO WEBrick::HTTPServer#start: pid=2626 port=8080
【问题讨论】:
-
你安装了 ruby 2.1.4 吗?在命令行上运行
rvm list的输出是什么? -
如果您使用的是 Rails 运行器,它默认为 2.1.5@rails4,可能会导致问题。可以试试在命令行运行
rails s -b $IP -p $PORT,看看输出是不是一样? -
非常抱歉回复晚了。在我的问题中添加了输出。
-
那么,如果你通过命令行运行rails就可以了?
-
是的,确实如此。有没有办法可以配置 IDE 来做同样的事情?
标签: ruby-on-rails ruby cloud9-ide